diff -urNEBb gcc-2.95.3-orig/config.guess gcc-2.95.3/config.guess
--- gcc-2.95.3-orig/config.guess	2000-03-08 05:52:57.000000000 +0100
+++ gcc-2.95.3/config.guess	2003-12-02 17:50:54.000000000 +0100
@@ -1,7 +1,10 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 93, 94, 95, 96, 97, 1998, 1999 Free Software Foundation, Inc.
-#
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002 Free Software Foundation, Inc.
+
+timestamp='2002-05-22'
+
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 2 of the License, or
@@ -21,22 +24,97 @@
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
-# Written by Per Bothner <bothner@cygnus.com>.
-# The master version of this file is at the FSF in /home/gd/gnu/lib.
+# Originally written by Per Bothner <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
 #
 # This script attempts to guess a canonical system name similar to
 # config.sub.  If it succeeds, it prints the system name on stdout, and
 # exits with 0.  Otherwise, it exits with 1.
 #
 # The plan is that this can be called by configure scripts if you
-# don't specify an explicit system type (host/target name).
-#
-# Only a few systems have been added to this list; please add others
-# (but try to keep the structure clean).
-#
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit 0 ;;
+    --version | -v )
+       echo "$version" ; exit 0 ;;
+    --help | --h* | -h )
+       echo "$usage"; exit 0 ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help" >&2
+       exit 1 ;;
+    * )
+       break ;;
+  esac
+done
+
+if test $# != 0; then
+  echo "$me: too many arguments$help" >&2
+  exit 1
+fi
+
+
+dummy=dummy-$$
+trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script.
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,)    echo "int dummy(){}" > $dummy.c ;
+	for c in cc gcc c89 c99 ; do
+	  ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
+	  if test $? = 0 ; then
+	     CC_FOR_BUILD="$c"; break ;
+	  fi ;
+	done ;
+	rm -f $dummy.c $dummy.o $dummy.rel ;
+	if test x"$CC_FOR_BUILD" = x ; then
+	  CC_FOR_BUILD=no_compiler_found ;
+	fi
+	;;
+ ,,*)   CC_FOR_BUILD=$CC ;;
+ ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+esac'
 
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 8/24/94.)
+# (ghazi@noc.rutgers.edu 1994-08-24)
 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
 	PATH=$PATH:/.attbin ; export PATH
 fi
@@ -46,11 +124,95 @@
 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
-trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
-
 # Note: order is significant - the case branches are not exclusive.
 
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+    *:NetBSD:*:*)
+	# NetBSD (nbsd) targets should (where applicable) match one or
+	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
+	# switched to ELF, *-*-netbsd* would select the old
+	# object file format.  This provides both forward
+	# compatibility and a consistent mechanism for selecting the
+	# object file format.
+	#
+	# Note: NetBSD doesn't particularly care about the vendor
+	# portion of the name.  We always set it to "unknown".
+	sysctl="sysctl -n hw.machine_arch"
+	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+	case "${UNAME_MACHINE_ARCH}" in
+	    armeb) machine=armeb-unknown ;;
+	    arm*) machine=arm-unknown ;;
+	    sh3el) machine=shl-unknown ;;
+	    sh3eb) machine=sh-unknown ;;
+	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+	esac
+	# The Operating System including object format, if it has switched
+	# to ELF recently, or will in the future.
+	case "${UNAME_MACHINE_ARCH}" in
+	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+		eval $set_cc_for_build
+		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+			| grep __ELF__ >/dev/null
+		then
+		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+		    # Return netbsd for either.  FIX?
+		    os=netbsd
+		else
+		    os=netbsdelf
+		fi
+		;;
+	    *)
+	        os=netbsd
+		;;
+	esac
+	# The OS release
+	release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+	# contains redundant information, the shorter form:
+	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+	echo "${machine}-${os}${release}"
+	exit 0 ;;
+    amiga:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    arc:OpenBSD:*:*)
+	echo mipsel-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    hp300:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mac68k:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    macppc:OpenBSD:*:*)
+	echo powerpc-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mvme68k:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mvme88k:OpenBSD:*:*)
+	echo m88k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mvmeppc:OpenBSD:*:*)
+	echo powerpc-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    pmax:OpenBSD:*:*)
+	echo mipsel-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    sgi:OpenBSD:*:*)
+	echo mipseb-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    sun3:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    wgrisc:OpenBSD:*:*)
+	echo mipsel-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    *:OpenBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
     alpha:OSF1:*:*)
 	if test $UNAME_RELEASE = "V4.0"; then
 		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
@@ -59,96 +221,89 @@
 	# A Tn.n version is a released field test version.
 	# A Xn.n version is an unreleased experimental baselevel.
 	# 1.2 uses "1.2" for uname -r.
-	cat <<EOF >dummy.s
+	cat <<EOF >$dummy.s
+	.data
+\$Lformat:
+	.byte 37,100,45,37,120,10,0	# "%d-%x\n"
+
+	.text
 	.globl main
+	.align 4
 	.ent main
 main:
-	.frame \$30,0,\$26,0
-	.prologue 0
-	.long 0x47e03d80 # implver $0
-	lda \$2,259
-	.long 0x47e20c21 # amask $2,$1
-	srl \$1,8,\$2
-	sll \$2,2,\$2
-	sll \$0,3,\$0
-	addl \$1,\$0,\$0
-	addl \$2,\$0,\$0
-	ret \$31,(\$26),1
+	.frame \$30,16,\$26,0
+	ldgp \$29,0(\$27)
+	.prologue 1
+	.long 0x47e03d80 # implver \$0
+	lda \$2,-1
+	.long 0x47e20c21 # amask \$2,\$1
+	lda \$16,\$Lformat
+	mov \$0,\$17
+	not \$1,\$18
+	jsr \$26,printf
+	ldgp \$29,0(\$26)
+	mov 0,\$16
+	jsr \$26,exit
 	.end main
 EOF
-	${CC-cc} dummy.s -o dummy 2>/dev/null
+	eval $set_cc_for_build
+	$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
 	if test "$?" = 0 ; then
-		./dummy
-		case "$?" in
-			7)
+		case `./$dummy` in
+			0-0)
 				UNAME_MACHINE="alpha"
 				;;
-			15)
+			1-0)
 				UNAME_MACHINE="alphaev5"
 				;;
-			14)
+			1-1)
 				UNAME_MACHINE="alphaev56"
 				;;
-			10)
+			1-101)
 				UNAME_MACHINE="alphapca56"
 				;;
-			16)
+			2-303)
 				UNAME_MACHINE="alphaev6"
 				;;
+			2-307)
+				UNAME_MACHINE="alphaev67"
+				;;
+			2-1307)
+				UNAME_MACHINE="alphaev68"
+				;;
 		esac
 	fi
-	rm -f dummy.s dummy
+	rm -f $dummy.s $dummy
 	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
 	exit 0 ;;
     Alpha\ *:Windows_NT*:*)
-        # How do we know it's Interix rather than generic posix subsystem?
-	# Should we change UNAME_MACHINE based on the output of uname 
-	# instead of the specific alpha model.
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# Should we change UNAME_MACHINE based on the output of uname instead
+	# of the specific Alpha model?
 	echo alpha-pc-interix
-	exit 0;;
+	exit 0 ;;
     21064:Windows_NT:50:3)
 	echo alpha-dec-winnt3.5
 	exit 0 ;;
     Amiga*:UNIX_System_V:4.0:*)
-	echo m68k-cbm-sysv4
+	echo m68k-unknown-sysv4
 	exit 0;;
-    amiga:NetBSD:*:*)
-      echo m68k-cbm-netbsd${UNAME_RELEASE}
-      exit 0 ;;
-    amiga:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
     *:[Aa]miga[Oo][Ss]:*:*)
 	echo ${UNAME_MACHINE}-unknown-amigaos
 	exit 0 ;;
-    arc64:OpenBSD:*:*)
-	echo mips64el-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    arc:OpenBSD:*:*)
-	echo mipsel-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    hkmips:OpenBSD:*:*)
-	echo mips-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    pmax:OpenBSD:*:*)
-	echo mipsel-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    sgi:OpenBSD:*:*)
-	echo mips-unknown-openbsd${UNAME_RELEASE}
+    *:[Mm]orph[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-morphos
 	exit 0 ;;
-    wgrisc:OpenBSD:*:*)
-	echo mipsel-unknown-openbsd${UNAME_RELEASE}
+    *:OS/390:*:*)
+	echo i370-ibm-openedition
 	exit 0 ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
 	echo arm-acorn-riscix${UNAME_RELEASE}
 	exit 0;;
-    arm32:NetBSD:*:*)
-	echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
-	exit 0 ;;
-    SR2?01:HI-UX/MPP:*:*)
+    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
 	echo hppa1.1-hitachi-hiuxmpp
 	exit 0;;
-    Pyramid*:OSx*:*:*|MIS*:OSx*:*:*)
+    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
 	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
 	if test "`(/bin/universe) 2>/dev/null`" = att ; then
 		echo pyramid-pyramid-sysv3
@@ -156,7 +311,7 @@
 		echo pyramid-pyramid-bsd
 	fi
 	exit 0 ;;
-    NILE:*:*:dcosx)
+    NILE*:*:*:dcosx)
 	echo pyramid-pyramid-svr4
 	exit 0 ;;
     sun4H:SunOS:5.*:*)
@@ -187,7 +342,7 @@
 	echo m68k-sun-sunos${UNAME_RELEASE}
 	exit 0 ;;
     sun*:*:4.2BSD:*)
-	UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
 	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
 	case "`/bin/arch`" in
 	    sun3)
@@ -201,29 +356,31 @@
     aushp:SunOS:*:*)
 	echo sparc-auspex-sunos${UNAME_RELEASE}
 	exit 0 ;;
-    atari*:NetBSD:*:*)
-	echo m68k-atari-netbsd${UNAME_RELEASE}
-	exit 0 ;;
-    atari*:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    sun3*:NetBSD:*:*)
-	echo m68k-sun-netbsd${UNAME_RELEASE}
-	exit 0 ;;
-    sun3*:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
+    # The situation for MiNT is a little confusing.  The machine name
+    # can be virtually everything (everything which is not
+    # "atarist" or "atariste" at least should have a processor
+    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
+    # to the lowercase version "mint" (or "freemint").  Finally
+    # the system name "TOS" denotes a system which is actually not
+    # MiNT.  But MiNT is downward compatible to TOS, so this should
+    # be no problem.
+    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit 0 ;;
+    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+	echo m68k-atari-mint${UNAME_RELEASE}
+        exit 0 ;;
+    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
 	exit 0 ;;
-    mac68k:NetBSD:*:*)
-	echo m68k-apple-netbsd${UNAME_RELEASE}
+    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+        echo m68k-milan-mint${UNAME_RELEASE}
 	exit 0 ;;
-    mac68k:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    mvme68k:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
+    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+        echo m68k-hades-mint${UNAME_RELEASE}
 	exit 0 ;;
-    mvme88k:OpenBSD:*:*)
-	echo m88k-unknown-openbsd${UNAME_RELEASE}
+    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+        echo m68k-unknown-mint${UNAME_RELEASE}
 	exit 0 ;;
     powerpc:machten:*:*)
 	echo powerpc-apple-machten${UNAME_RELEASE}
@@ -237,12 +394,18 @@
     VAX*:ULTRIX*:*:*)
 	echo vax-dec-ultrix${UNAME_RELEASE}
 	exit 0 ;;
-    2020:CLIX:*:*)
+    2020:CLIX:*:* | 2430:CLIX:*:*)
 	echo clipper-intergraph-clix${UNAME_RELEASE}
 	exit 0 ;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
-	sed 's/^	//' << EOF >dummy.c
-	int main (argc, argv) int argc; char **argv; {
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
+	int main (int argc, char *argv[]) {
+#else
+	int main (argc, argv) int argc; char *argv[]; {
+#endif
 	#if defined (host_mips) && defined (MIPSEB)
 	#if defined (SYSTYPE_SYSV)
 	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
@@ -257,12 +420,18 @@
 	  exit (-1);
 	}
 EOF
-	${CC-cc} dummy.c -o dummy \
-	  && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
-	  && rm dummy.c dummy && exit 0
-	rm -f dummy.c dummy
+	$CC_FOR_BUILD $dummy.c -o $dummy \
+	  && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+	  && rm -f $dummy.c $dummy && exit 0
+	rm -f $dummy.c $dummy
 	echo mips-mips-riscos${UNAME_RELEASE}
 	exit 0 ;;
+    Motorola:PowerMAX_OS:*:*)
+	echo powerpc-motorola-powermax
+	exit 0 ;;
+    Night_Hawk:*:*:PowerMAX_OS)
+	echo powerpc-harris-powermax
+	exit 0 ;;
     Night_Hawk:Power_UNIX:*:*)
 	echo powerpc-harris-powerunix
 	exit 0 ;;
@@ -278,14 +447,17 @@
     AViiON:dgux:*:*)
         # DG/UX returns AViiON for all architectures
         UNAME_PROCESSOR=`/usr/bin/uname -p`
-        if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
-	if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
-	     -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
+	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+	then
+	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+	       [ ${TARGET_BINARY_INTERFACE}x = x ]
+	    then
 		echo m88k-dg-dgux${UNAME_RELEASE}
 	else
 		echo m88k-dg-dguxbcs${UNAME_RELEASE}
 	fi
-        else echo i586-dg-dgux${UNAME_RELEASE}
+	else
+	    echo i586-dg-dgux${UNAME_RELEASE}
         fi
  	exit 0 ;;
     M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
@@ -307,12 +479,21 @@
     ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
 	echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
 	exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
-    i?86:AIX:*:*)
+    i*86:AIX:*:*)
 	echo i386-ibm-aix
 	exit 0 ;;
+    ia64:AIX:*:*)
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+	exit 0 ;;
     *:AIX:2:3)
 	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
-		sed 's/^		//' << EOF >dummy.c
+		eval $set_cc_for_build
+		sed 's/^		//' << EOF >$dummy.c
 		#include <sys/systemcfg.h>
 
 		main()
@@ -323,8 +504,8 @@
 			exit(0);
 			}
 EOF
-		${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
-		rm -f dummy.c dummy
+		$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
+		rm -f $dummy.c $dummy
 		echo rs6000-ibm-aix3.2.5
 	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
 		echo rs6000-ibm-aix3.2.4
@@ -332,8 +513,9 @@
 		echo rs6000-ibm-aix3.2
 	fi
 	exit 0 ;;
-    *:AIX:*:4)
-	if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
+    *:AIX:*:[45])
+	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
 		IBM_ARCH=rs6000
 	else
 		IBM_ARCH=powerpc
@@ -341,7 +523,7 @@
 	if [ -x /usr/bin/oslevel ] ; then
 		IBM_REV=`/usr/bin/oslevel`
 	else
-		IBM_REV=4.${UNAME_RELEASE}
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
 	fi
 	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
 	exit 0 ;;
@@ -351,7 +533,7 @@
     ibmrt:4.4BSD:*|romp-ibm:BSD:*)
 	echo romp-ibm-bsd4.4
 	exit 0 ;;
-    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC NetBSD and
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
 	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
 	exit 0 ;;                           # report: romp-ibm BSD 4.3
     *:BOSX:*:*)
@@ -366,16 +548,31 @@
     hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
 	echo m68k-hp-bsd4.4
 	exit 0 ;;
-    *9??*:MPE/iX:*:*)
-	echo hppa1.0-hp-mpeix
-	exit 0 ;;
     9000/[34678]??:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
 	case "${UNAME_MACHINE}" in
 	    9000/31? )            HP_ARCH=m68000 ;;
 	    9000/[34]?? )         HP_ARCH=m68k ;;
-	    9000/[678][0-9][0-9] )
+	    9000/[678][0-9][0-9])
+		if [ -x /usr/bin/getconf ]; then
+		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+                    case "${sc_cpu_version}" in
+                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+                      532)                      # CPU_PA_RISC2_0
+                        case "${sc_kernel_bits}" in
+                          32) HP_ARCH="hppa2.0n" ;;
+                          64) HP_ARCH="hppa2.0w" ;;
+			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
+                        esac ;;
+                    esac
+		fi
+		if [ "${HP_ARCH}" = "" ]; then
+		    eval $set_cc_for_build
+		    sed 's/^              //' << EOF >$dummy.c
 
-              sed 's/^              //' << EOF >dummy.c
+              #define _HPUX_SOURCE
               #include <stdlib.h>
               #include <unistd.h>
               
@@ -406,14 +603,20 @@
                   exit (0);
               }
 EOF
-	(${CC-cc} dummy.c -o dummy 2>/dev/null ) && HP_ARCH=`./dummy`
-	rm -f dummy.c dummy
+		    (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy`
+		    if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
+		    rm -f $dummy.c $dummy
+		fi ;;
 	esac
-	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
 	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
 	exit 0 ;;
+    ia64:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	echo ia64-hp-hpux${HPUX_REV}
+	exit 0 ;;
     3050*:HI-UX:*:*)
-	sed 's/^	//' << EOF >dummy.c
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
 	#include <unistd.h>
 	int
 	main ()
@@ -438,8 +641,8 @@
 	  exit (0);
 	}
 EOF
-	${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
-	rm -f dummy.c dummy
+	$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
+	rm -f $dummy.c $dummy
 	echo unknown-hitachi-hiuxwe2
 	exit 0 ;;
     9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
@@ -448,13 +651,16 @@
     9000/8??:4.3bsd:*:*)
 	echo hppa1.0-hp-bsd
 	exit 0 ;;
+    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+	echo hppa1.0-hp-mpeix
+	exit 0 ;;
     hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
 	echo hppa1.1-hp-osf
 	exit 0 ;;
     hp8??:OSF1:*:*)
 	echo hppa1.0-hp-osf
 	exit 0 ;;
-    i?86:OSF1:*:*)
+    i*86:OSF1:*:*)
 	if [ -x /usr/sbin/sysversion ] ; then
 	    echo ${UNAME_MACHINE}-unknown-osf1mk
 	else
@@ -464,9 +670,6 @@
     parisc*:Lites*:*:*)
 	echo hppa1.1-hp-lites
 	exit 0 ;;
-    hppa*:OpenBSD:*:*)
-	echo hppa-unknown-openbsd
-	exit 0 ;;
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
 	echo c1-convex-bsd
         exit 0 ;;
@@ -485,71 +688,68 @@
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
 	echo c4-convex-bsd
         exit 0 ;;
-    CRAY*X-MP:*:*:*)
-	echo xmp-cray-unicos
-        exit 0 ;;
     CRAY*Y-MP:*:*:*)
-	echo ymp-cray-unicos${UNAME_RELEASE}
+	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 	exit 0 ;;
     CRAY*[A-Z]90:*:*:*)
 	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
 	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
+	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+	      -e 's/\.[^.]*$/.X/'
 	exit 0 ;;
     CRAY*TS:*:*:*)
-	echo t90-cray-unicos${UNAME_RELEASE}
+	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 	exit 0 ;;
-    CRAY-2:*:*:*)
-	echo cray2-cray-unicos
-        exit 0 ;;
-    F300:UNIX_System_V:*:*)
-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
-        echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+    CRAY*T3D:*:*:*)
+	echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
         exit 0 ;;
-    F301:UNIX_System_V:*:*)
-       echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
+    CRAY*T3E:*:*:*)
+	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
        exit 0 ;;
-    hp3[0-9][05]:NetBSD:*:*)
-	echo m68k-hp-netbsd${UNAME_RELEASE}
+    CRAY*SV1:*:*:*)
+	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 	exit 0 ;;
-    hp300:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
+    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
 	exit 0 ;;
-    i?86:BSD/386:*:* | *:BSD/OS:*:*)
+    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
 	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
 	exit 0 ;;
-    *:FreeBSD:*:*)
-        if test -x /usr/bin/objformat -a "elf" = "`/usr/bin/objformat`"; then
-          echo ${UNAME_MACHINE}-unknown-freebsdelf
-        else
-	  echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
-      fi
+    sparc*:BSD/OS:*:*)
+	echo sparc-unknown-bsdi${UNAME_RELEASE}
 	exit 0 ;;
-    *:NetBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+    *:BSD/OS:*:*)
+	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
 	exit 0 ;;
-    *:OpenBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+    *:FreeBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
 	exit 0 ;;
     i*:CYGWIN*:*)
-	echo ${UNAME_MACHINE}-pc-cygwin32
+	echo ${UNAME_MACHINE}-pc-cygwin
 	exit 0 ;;
     i*:MINGW*:*)
 	echo ${UNAME_MACHINE}-pc-mingw32
 	exit 0 ;;
+    i*:PW*:*)
+	echo ${UNAME_MACHINE}-pc-pw32
+	exit 0 ;;
+    x86:Interix*:3*)
+	echo i386-pc-interix3
+	exit 0 ;;
     i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
-        # How do we know it's Interix rather than generic posix subsystem?
+	# How do we know it's Interix rather than the generic POSIX subsystem?
 	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
-	# change UNAME_MACHINE based on the output of uname instead of
-	# i386?
+	# UNAME_MACHINE based on the output of uname instead of i386?
 	echo i386-pc-interix
 	exit 0 ;;
     i*:UWIN*:*)
 	echo ${UNAME_MACHINE}-pc-uwin
 	exit 0 ;;
     p*:CYGWIN*:*)
-	echo powerpcle-unknown-cygwin32
+	echo powerpcle-unknown-cygwin
 	exit 0 ;;
     prep*:SunOS:5.*:*)
 	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
@@ -557,175 +757,142 @@
     *:GNU:*:*)
 	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
 	exit 0 ;;
-    *:Linux:*:*)
-	# uname on the ARM produces all sorts of strangeness, and we need to
-	# filter it out.
-	case "$UNAME_MACHINE" in
-	  armv*)		      UNAME_MACHINE=$UNAME_MACHINE ;;
-	  arm* | sa110*)	      UNAME_MACHINE="arm" ;;
+    i*86:Minix:*:*)
+	echo ${UNAME_MACHINE}-pc-minix
+	exit 0 ;;
+    arm*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    ia64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    m68*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    mips:Linux:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#undef CPU
+	#undef mips
+	#undef mipsel
+	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+	CPU=mipsel
+	#else
+	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+	CPU=mips
+	#else
+	CPU=
+	#endif
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+	rm -f $dummy.c
+	test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
+	;;
+    ppc:Linux:*:*)
+	echo powerpc-unknown-linux-gnu
+	exit 0 ;;
+    ppc64:Linux:*:*)
+	echo powerpc64-unknown-linux-gnu
+	exit 0 ;;
+    alpha:Linux:*:*)
+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+	  EV5)   UNAME_MACHINE=alphaev5 ;;
+	  EV56)  UNAME_MACHINE=alphaev56 ;;
+	  PCA56) UNAME_MACHINE=alphapca56 ;;
+	  PCA57) UNAME_MACHINE=alphapca56 ;;
+	  EV6)   UNAME_MACHINE=alphaev6 ;;
+	  EV67)  UNAME_MACHINE=alphaev67 ;;
+	  EV68*) UNAME_MACHINE=alphaev68 ;;
 	esac
-
+	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	exit 0 ;;
+    parisc:Linux:*:* | hppa:Linux:*:*)
+	# Look for CPU level
+	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
+	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
+	  *)    echo hppa-unknown-linux-gnu ;;
+	esac
+	exit 0 ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+	echo hppa64-unknown-linux-gnu
+	exit 0 ;;
+    s390:Linux:*:* | s390x:Linux:*:*)
+	echo ${UNAME_MACHINE}-ibm-linux
+	exit 0 ;;
+    sh*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    sparc:Linux:*:* | sparc64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    x86_64:Linux:*:*)
+	echo x86_64-unknown-linux-gnu
+	exit 0 ;;
+    i*86:Linux:*:*)
 	# The BFD linker knows what the default object file format is, so
-	# first see if it will tell us.
-	ld_help_string=`ld --help 2>&1`
-	ld_supported_emulations=`echo $ld_help_string \
-			 | sed -ne '/supported emulations:/!d
+	# first see if it will tell us. cd to the root directory to prevent
+	# problems with other programs or directories called `ld' in the path.
+	# Set LC_ALL=C to ensure ld outputs messages in English.
+	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
+			 | sed -ne '/supported targets:/!d
 				    s/[ 	][ 	]*/ /g
-				    s/.*supported emulations: *//
+				    s/.*supported targets: *//
 				    s/ .*//
 				    p'`
-        case "$ld_supported_emulations" in
-	  i?86linux)  echo "${UNAME_MACHINE}-pc-linux-gnuaout"      ; exit 0 ;;
-	  i?86coff)   echo "${UNAME_MACHINE}-pc-linux-gnucoff"      ; exit 0 ;;
-	  sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
-	  armlinux)   echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
-	  m68klinux)  echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
-	  elf32ppc | elf32ppclinux)
-		# Determine Lib Version
-		cat >dummy.c <<EOF
-#include <features.h>
-#if defined(__GLIBC__)
-extern char __libc_version[];
-extern char __libc_release[];
-#endif
-main(argc, argv)
-     int argc;
-     char *argv[];
-{
-#if defined(__GLIBC__)
-  printf("%s %s\n", __libc_version, __libc_release);
-#else
-  printf("unkown\n");
-#endif
-  return 0;
-}
-EOF
-		LIBC=""
-		${CC-cc} dummy.c -o dummy 2>/dev/null
-		if test "$?" = 0 ; then
-			./dummy | grep 1\.99 > /dev/null
-			if test "$?" = 0 ; then
-				LIBC="libc1"
-			fi
-		fi	
-		rm -f dummy.c dummy
-		echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;;
-	esac
-
-	if test "${UNAME_MACHINE}" = "alpha" ; then
-		sed 's/^	//'  <<EOF >dummy.s
-		.globl main
-		.ent main
-	main:
-		.frame \$30,0,\$26,0
-		.prologue 0
-		.long 0x47e03d80 # implver $0
-		lda \$2,259
-		.long 0x47e20c21 # amask $2,$1
-		srl \$1,8,\$2
-		sll \$2,2,\$2
-		sll \$0,3,\$0
-		addl \$1,\$0,\$0
-		addl \$2,\$0,\$0
-		ret \$31,(\$26),1
-		.end main
-EOF
-		LIBC=""
-		${CC-cc} dummy.s -o dummy 2>/dev/null
-		if test "$?" = 0 ; then
-			./dummy
-			case "$?" in
-			7)
-				UNAME_MACHINE="alpha"
-				;;
-			15)
-				UNAME_MACHINE="alphaev5"
-				;;
-			14)
-				UNAME_MACHINE="alphaev56"
-				;;
-			10)
-				UNAME_MACHINE="alphapca56"
-				;;
-			16)
-				UNAME_MACHINE="alphaev6"
-				;;
-			esac	
-
-			objdump --private-headers dummy | \
-			  grep ld.so.1 > /dev/null
-			if test "$?" = 0 ; then
-				LIBC="libc1"
-			fi
-		fi	
-		rm -f dummy.s dummy
-		echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
-	elif test "${UNAME_MACHINE}" = "mips" ; then
-	  cat >dummy.c <<EOF
-main(argc, argv)
-     int argc;
-     char *argv[];
-{
-#ifdef __MIPSEB__
-  printf ("%s-unknown-linux-gnu\n", argv[1]);
-#endif
-#ifdef __MIPSEL__
-  printf ("%sel-unknown-linux-gnu\n", argv[1]);
-#endif
-  return 0;
-}
-EOF
-	  ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
-	  rm -f dummy.c dummy
-	else
-	  # Either a pre-BFD a.out linker (linux-gnuoldld)
-	  # or one that does not give us useful --help.
-	  # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
-	  # If ld does not provide *any* "supported emulations:"
-	  # that means it is gnuoldld.
-	  echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
-	  test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
-
-	  case "${UNAME_MACHINE}" in
-	  i?86)
-	    VENDOR=pc;
-	    ;;
-	  *)
-	    VENDOR=unknown;
+        case "$ld_supported_targets" in
+	  elf32-i386)
+		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
 	    ;;
+	  a.out-i386-linux)
+		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+		exit 0 ;;		
+	  coff-i386)
+		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+		exit 0 ;;
+	  "")
+		# Either a pre-BFD a.out linker (linux-gnuoldld) or
+		# one that does not give us useful --help.
+		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+		exit 0 ;;
 	  esac
 	  # Determine whether the default compiler is a.out or elf
-	  cat >dummy.c <<EOF
-#include <features.h>
-main(argc, argv)
-     int argc;
-     char *argv[];
-{
-#ifdef __ELF__
-# ifdef __GLIBC__
-#  if __GLIBC__ >= 2
-    printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
-#  else
-    printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
-#  endif
-# else
-   printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
-# endif
-#else
-  printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
-#endif
-  return 0;
-}
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <features.h>
+	#ifdef __ELF__
+	# ifdef __GLIBC__
+	#  if __GLIBC__ >= 2
+	LIBC=gnu
+	#  else
+	LIBC=gnulibc1
+	#  endif
+	# else
+	LIBC=gnulibc1
+	# endif
+	#else
+	#ifdef __INTEL_COMPILER
+	LIBC=gnu
+	#else
+	LIBC=gnuaout
+	#endif
+	#endif
 EOF
-	  ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
-	  rm -f dummy.c dummy
-	fi ;;
-# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.  earlier versions
-# are messed up and put the nodename in both sysname and nodename.
-    i?86:DYNIX/ptx:4*:*)
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+	rm -f $dummy.c
+	test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
+	test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+	;;
+    i*86:DYNIX/ptx:4*:*)
+	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+	# earlier versions are messed up and put the nodename in both
+	# sysname and nodename.
 	echo i386-sequent-sysv4
 	exit 0 ;;
-    i?86:UNIX_SV:4.2MP:2.*)
+    i*86:UNIX_SV:4.2MP:2.*)
         # Unixware is an offshoot of SVR4, but it has its own version
         # number series starting with 2...
         # I am not positive that other SVR4 systems won't match this,
@@ -733,26 +900,23 @@
         # Use sysv4.2uw... so that sysv4* matches it.
 	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
 	exit 0 ;;
-    i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
+    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
 	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
-		echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
+		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
 	else
-		echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
+		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
 	fi
 	exit 0 ;;
-    i?86:*:5:7*)
-       UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
-       (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
-       (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
-               && UNAME_MACHINE=i586
-# 5.0.4c returns "Pent II".  5.0.5 returns PentII
-       (/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) \
-               && UNAME_MACHINE=i686
-       (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
-               && UNAME_MACHINE=i686
-       echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE}
+    i*86:*:5:[78]*)
+	case `/bin/uname -X | grep "^Machine"` in
+	    *486*)	     UNAME_MACHINE=i486 ;;
+	    *Pentium)	     UNAME_MACHINE=i586 ;;
+	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+	esac
+	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
        exit 0 ;;
-    i?86:*:3.2:*)
+    i*86:*:3.2:*)
 	if test -f /usr/options/cb.name; then
 		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
 		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
@@ -761,9 +925,7 @@
 		(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
 		(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
 			&& UNAME_MACHINE=i586
-		(/bin/uname -X|egrep '^Machine.*PentII' >/dev/null) \
-			&& UNAME_MACHINE=i686
-		(/bin/uname -X|egrep '^Machine.*Pent II' >/dev/null) \
+		(/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
 			&& UNAME_MACHINE=i686
                 (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
                         && UNAME_MACHINE=i686
@@ -772,7 +934,11 @@
 		echo ${UNAME_MACHINE}-pc-sysv32
 	fi
 	exit 0 ;;
+    i*86:*DOS:*:*)
+	echo ${UNAME_MACHINE}-pc-msdosdjgpp
+	exit 0 ;;
     pc:*:*:*)
+	# Left here for compatibility:
         # uname -m prints for DJGPP always 'pc', but it prints nothing about
         # the processor, so we play safe by assuming i386.
 	echo i386-pc-msdosdjgpp
@@ -796,7 +962,7 @@
 	exit 0 ;;
     M68*:*:R3V[567]*:*)
 	test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
-    3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
+    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0)
 	OS_REL=''
 	test -r /etc/.relid \
 	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
@@ -807,28 +973,31 @@
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
           && echo i486-ncr-sysv4 && exit 0 ;;
-    m68*:LynxOS:2.*:*)
+    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
 	echo m68k-unknown-lynxos${UNAME_RELEASE}
 	exit 0 ;;
     mc68030:UNIX_System_V:4.*:*)
 	echo m68k-atari-sysv4
 	exit 0 ;;
-    i?86:LynxOS:2.*:*)
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
 	echo i386-unknown-lynxos${UNAME_RELEASE}
 	exit 0 ;;
     TSUNAMI:LynxOS:2.*:*)
 	echo sparc-unknown-lynxos${UNAME_RELEASE}
 	exit 0 ;;
-    rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
+    rs6000:LynxOS:2.*:*)
 	echo rs6000-unknown-lynxos${UNAME_RELEASE}
 	exit 0 ;;
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+	echo powerpc-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
     SM[BE]S:UNIX_SV:*:*)
 	echo mips-dde-sysv${UNAME_RELEASE}
 	exit 0 ;;
-    RM*:SINIX-*:*:*)
+    RM*:ReliantUNIX-*:*:*)
 	echo mips-sni-sysv4
 	exit 0 ;;
-    RM*:ReliantUNIX-*:*:*)
+    RM*:SINIX-*:*:*)
 	echo mips-sni-sysv4
 	exit 0 ;;
     *:SINIX-*:*:*)
@@ -839,7 +1008,7 @@
 		echo ns32k-sni-sysv
 	fi
 	exit 0 ;;
-    PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
                            # says <Richard.M.Bartel@ccMail.Census.GOV>
         echo i586-unisys-sysv4
         exit 0 ;;
@@ -852,13 +1021,17 @@
 	# From seanf@swdc.stratus.com.
 	echo i860-stratus-sysv4
 	exit 0 ;;
+    *:VOS:*:*)
+	# From Paul.Green@stratus.com.
+	echo hppa1.1-stratus-vos
+	exit 0 ;;
     mc68*:A/UX:*:*)
 	echo m68k-apple-aux${UNAME_RELEASE}
 	exit 0 ;;
-    news*:NEWS-OS:*:6*)
+    news*:NEWS-OS:6*:*)
 	echo mips-sony-newsos6
 	exit 0 ;;
-    R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*)
+    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
 	if [ -d /usr/nec ]; then
 	        echo mips-nec-sysv${UNAME_RELEASE}
 	else
@@ -874,12 +1047,91 @@
     BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
 	echo i586-pc-beos
 	exit 0 ;;
+    SX-4:SUPER-UX:*:*)
+	echo sx4-nec-superux${UNAME_RELEASE}
+	exit 0 ;;
+    SX-5:SUPER-UX:*:*)
+	echo sx5-nec-superux${UNAME_RELEASE}
+	exit 0 ;;
+    Power*:Rhapsody:*:*)
+	echo powerpc-apple-rhapsody${UNAME_RELEASE}
+	exit 0 ;;
+    *:Rhapsody:*:*)
+	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+	exit 0 ;;
+    *:Darwin:*:*)
+	echo `uname -p`-apple-darwin${UNAME_RELEASE}
+	exit 0 ;;
+    *:procnto*:*:* | *:QNX:[0123456789]*:*)
+	UNAME_PROCESSOR=`uname -p`
+	if test "$UNAME_PROCESSOR" = "x86"; then
+		UNAME_PROCESSOR=i386
+		UNAME_MACHINE=pc
+	fi
+	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+	exit 0 ;;
+    *:QNX:*:4*)
+	echo i386-pc-qnx
+	exit 0 ;;
+    NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*)
+	echo nsr-tandem-nsk${UNAME_RELEASE}
+	exit 0 ;;
+    *:NonStop-UX:*:*)
+	echo mips-compaq-nonstopux
+	exit 0 ;;
+    BS2000:POSIX*:*:*)
+	echo bs2000-siemens-sysv
+	exit 0 ;;
+    DS/*:UNIX_System_V:*:*)
+	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+	exit 0 ;;
+    *:Plan9:*:*)
+	# "uname -m" is not consistent, so use $cputype instead. 386
+	# is converted to i386 for consistency with other x86
+	# operating systems.
+	if test "$cputype" = "386"; then
+	    UNAME_MACHINE=i386
+	else
+	    UNAME_MACHINE="$cputype"
+	fi
+	echo ${UNAME_MACHINE}-unknown-plan9
+	exit 0 ;;
+    i*86:OS/2:*:*)
+	# If we were able to find `uname', then EMX Unix compatibility
+	# is probably installed.
+	echo ${UNAME_MACHINE}-pc-os2-emx
+	exit 0 ;;
+    *:TOPS-10:*:*)
+	echo pdp10-unknown-tops10
+	exit 0 ;;
+    *:TENEX:*:*)
+	echo pdp10-unknown-tenex
+	exit 0 ;;
+    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+	echo pdp10-dec-tops20
+	exit 0 ;;
+    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+	echo pdp10-xkl-tops20
+	exit 0 ;;
+    *:TOPS-20:*:*)
+	echo pdp10-unknown-tops20
+	exit 0 ;;
+    *:ITS:*:*)
+	echo pdp10-unknown-its
+	exit 0 ;;
+    i*86:XTS-300:*:STOP)
+	echo ${UNAME_MACHINE}-unknown-stop
+	exit 0 ;;
+    i*86:atheos:*:*)
+	echo ${UNAME_MACHINE}-unknown-atheos
+	exit 0 ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
 
-cat >dummy.c <<EOF
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
 #ifdef _SEQUENT_
 # include <sys/types.h>
 # include <sys/utsname.h>
@@ -917,7 +1169,10 @@
 #endif
   int version;
   version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+  if (version < 4)
   printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  else
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
   exit (0);
 #endif
 
@@ -962,11 +1217,24 @@
 #endif
 
 #if defined (vax)
-#if !defined (ultrix)
+# if !defined (ultrix)
+#  include <sys/param.h>
+#  if defined (BSD)
+#   if BSD == 43
+      printf ("vax-dec-bsd4.3\n"); exit (0);
+#   else
+#    if BSD == 199006
+      printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#    else
   printf ("vax-dec-bsd\n"); exit (0);
-#else
+#    endif
+#   endif
+#  else
+    printf ("vax-dec-bsd\n"); exit (0);
+#  endif
+# else
   printf ("vax-dec-ultrix\n"); exit (0);
-#endif
+# endif
 #endif
 
 #if defined (alliant) && defined (i860)
@@ -977,8 +1245,8 @@
 }
 EOF
 
-${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
-rm -f dummy.c dummy
+$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
+rm -f $dummy.c $dummy
 
 # Apollos put the system type in the environment.
 
@@ -1010,6 +1278,48 @@
     esac
 fi
 
-#echo '(Unable to guess system type)' 1>&2
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+    ftp://ftp.gnu.org/pub/gnu/config/
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo               = `(hostinfo) 2>/dev/null`
+/bin/universe          = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch              = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM  = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
 
 exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff -urNEBb gcc-2.95.3-orig/config.sub gcc-2.95.3/config.sub
--- gcc-2.95.3-orig/config.sub	1999-08-04 10:09:26.000000000 +0200
+++ gcc-2.95.3/config.sub	2003-12-02 17:50:54.000000000 +0100
@@ -1,6 +1,10 @@
 #! /bin/sh
-# Configuration validation subroutine script, version 1.1.
-#   Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc.
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002 Free Software Foundation, Inc.
+
+timestamp='2002-05-22'
+
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
 # can handle that machine.  It does not imply ALL GNU software can.
@@ -25,6 +29,9 @@
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
+# Please send patches to <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
 # Configuration subroutine to validate and canonicalize a configuration type.
 # Supply the specified configuration type as an argument.
 # If it is invalid, we print an error message on stderr and exit with code 1.
@@ -45,30 +52,73 @@
 #	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
 # It is wrong to echo any other type of specification.
 
-if [ x$1 = x ]
-then
-	echo Configuration name missing. 1>&2
-	echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
-	echo "or     $0 ALIAS" 1>&2
-	echo where ALIAS is a recognized configuration type. 1>&2
-	exit 1
-fi
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+       $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit 0 ;;
+    --version | -v )
+       echo "$version" ; exit 0 ;;
+    --help | --h* | -h )
+       echo "$usage"; exit 0 ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help"
+       exit 1 ;;
 
-# First pass through any local machine types.
-case $1 in
 	*local*)
+       # First pass through any local machine types.
 		echo $1
-		exit 0
-		;;
-	*)
-	;;
+       exit 0;;
+
+    * )
+       break ;;
+  esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+    exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+    exit 1;;
 esac
 
 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  linux-gnu*)
+  nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
@@ -94,20 +144,28 @@
 	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
 	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
 	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-	-apple)
+	-apple | -axis)
 		os=
 		basic_machine=$1
 		;;
-	-sim | -cisco | -oki | -wec | -winbond )	# EGCS LOCAL
+	-sim | -cisco | -oki | -wec | -winbond)
 		os=
 		basic_machine=$1
 		;;
-	-scout)						# EGCS LOCAL
+	-scout)
 		;;
-	-wrs)						# EGCS LOCAL
+	-wrs)
 		os=-vxworks
 		basic_machine=$1
 		;;
+	-chorusos*)
+		os=-chorusos
+		basic_machine=$1
+		;;
+ 	-chorusrdb)
+ 		os=-chorusrdb
+		basic_machine=$1
+ 		;;
 	-hiux*)
 		os=-hiuxwe2
 		;;
@@ -156,45 +214,56 @@
 	-psos*)
 		os=-psos
 		;;
+	-mint | -mint[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
 esac
 
 # Decode aliases for certain CPU-COMPANY combinations.
 case $basic_machine in
 	# Recognize the basic CPU types without company name.
 	# Some are omitted here because they have special meanings below.
-	tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
-		| arme[lb] | pyramid | mn10200 | mn10300 \
-		| tron | a29k | 580 | i960 | h8300 \
-		| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
-		| alpha | alphaev5 | alphaev56 | alphapca56 | alphaev6 \
-		| we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
-		| 1750a | dsp16xx | pdp11 \
-		| mips64 | mipsel | mips64el | mips64orion | mips64orionel \
-		| mipstx39 | mipstx39el \
-		| sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x)
-		basic_machine=$basic_machine-unknown
-		;;
-	m88110 | m680[012346]0 | m683?2 | m68360 | m5200 | z8k | v70 \
-	        | h8500 | w65) # EGCS LOCAL
-		;;
-	thumb)
+	1750a | 580 \
+	| a29k \
+	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+	| c4x | clipper \
+	| d10v | d30v | dlx | dsp16xx \
+	| fr30 | frv \
+	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| i370 | i860 | i960 | ia64 \
+	| m32r | m68000 | m68k | m88k | mcore \
+	| mips | mips16 | mips64 | mips64el | mips64orion | mips64orionel \
+	| mips64vr4100 | mips64vr4100el | mips64vr4300 \
+	| mips64vr4300el | mips64vr5000 | mips64vr5000el \
+	| mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \
+	| mipsisa32 | mipsisa64 \
+	| mn10200 | mn10300 \
+	| ns16k | ns32k \
+	| openrisc | or32 \
+	| pdp10 | pdp11 | pj | pjl \
+	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+	| pyramid \
+	| sh | sh[34] | sh[34]eb | shbe | shle | sh64 \
+	| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
+	| strongarm \
+	| tahoe | thumb | tic80 | tron \
+	| v850 | v850e \
+	| we32k \
+	| x86 | xscale | xstormy16 | xtensa \
+	| z8k)
 		basic_machine=$basic_machine-unknown
 		;;
-	mips64vr4300 | mips64vr4300el) # EGCS LOCAL jsmith/vr4300
-		basic_machine=$basic_machine-unknown
-		;;
-	mips64vr4100 | mips64vr4100el) # EGCS LOCAL jsmith/vr4100
-		basic_machine=$basic_machine-unknown
-		;;
-	mips64vr5000 | mips64vr5000el) # EGCS LOCAL ian/vr5000
-		basic_machine=$basic_machine-unknown
-		;;
-	mips16)
+	m6811 | m68hc11 | m6812 | m68hc12)
+		# Motorola 68HC11/12.
 		basic_machine=$basic_machine-unknown
+		os=-none
 		;;
-	d10v)
-		basic_machine=$basic_machine-unknown
+	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
 		;;
+
 	# We use `pc' rather than `unknown'
 	# because (1) that's what they normally are, and
 	# (2) the word "unknown" tends to confuse beginning users.
@@ -198,7 +267,7 @@
 	# We use `pc' rather than `unknown'
 	# because (1) that's what they normally are, and
 	# (2) the word "unknown" tends to confuse beginning users.
-	i[34567]86)
+	i*86 | x86_64)
 	  basic_machine=$basic_machine-pc
 	  ;;
 	# Object if more than one company name word.
@@ -207,44 +276,49 @@
 		exit 1
 		;;
 	# Recognize the basic CPU types with company name.
-	vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
-	      | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
-	      | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
-	      | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
-	      | xmp-* | ymp-* \
-	      | hppa-* | hppa1.0-* | hppa1.1-* \
-	      | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
-	      | alpha-* | alphaev5-* | alphaev56-* | alphapca56-* \
-	      | alphaev6-* | we32k-* | cydra-* | ns16k-* | pn-* | np1-* \
-	      | xps100-* | clipper-* | orion-* \
-	      | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
-	      | sparc64-* | sparcv9-* | sparc86x-* | mips64-* | mipsel-* \
-	      | mips64el-* | mips64orion-* | mips64orionel-*  \
-	      | mipstx39-* | mipstx39el-* \
-	      | f301-* | arm*-*)
-		;;
-	m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | h8500-* | d10v-*) # EGCS LOCAL
-		;;
-	thumb-*) # EGCS LOCAL angela/thumb
-		;;
-	v850-*) # EGCS LOCAL
-	        ;;
-	d30v-*) # EGCS LOCAL
-	        ;;
-	mips64vr4300-* | mips64vr4300el-*) # EGCS LOCAL jsmith/vr4300
-		;;
-	mips64vr4100-* | mips64vr4100el-*) # EGCS LOCAL jsmith/vr4100
-		;;
-	mips16-*) # EGCS LOCAL krk/mips16
-		;;
-	tic30-*) # EGCS LOCAL ian/tic30
-		;;
-	c30-*) # EGCS LOCAL ian/tic30
-		basic_machine=tic30-unknown
+	580-* \
+	| a29k-* \
+	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
+	| avr-* \
+	| bs2000-* \
+	| c[123]* | c30-* | [cjt]90-* | c54x-* \
+	| clipper-* | cydra-* \
+	| d10v-* | d30v-* | dlx-* \
+	| elxsi-* \
+	| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+	| h8300-* | h8500-* \
+	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+	| i*86-* | i860-* | i960-* | ia64-* \
+	| m32r-* \
+	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+	| m88110-* | m88k-* | mcore-* \
+	| mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
+	| mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
+	| mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \
+	| mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \
+	| none-* | np1-* | ns16k-* | ns32k-* \
+	| orion-* \
+	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+	| pyramid-* \
+	| romp-* | rs6000-* \
+	| sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* | sh64-* \
+	| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
+	| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+	| tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
+	| v850-* | v850e-* | vax-* \
+	| we32k-* \
+	| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
+	| xtensa-* \
+	| ymp-* \
+	| z8k-*)
 		;;
 	# Recognize the various machine names and aliases which stand
 	# for a CPU type and a company and sometimes even an OS.
-	386bsd)						# EGCS LOCAL
+	386bsd)
 		basic_machine=i386-unknown
 		os=-bsd
 		;;
@@ -254,11 +328,11 @@
 	3b*)
 		basic_machine=we32k-att
 		;;
-	a29khif)					# EGCS LOCAL
+	a29khif)
 		basic_machine=a29k-amd
 		os=-udi
 		;;
-	adobe68k)					# EGCS LOCAL
+	adobe68k)
 		basic_machine=m68010-adobe
 		os=-scout
 		;;
@@ -276,22 +350,19 @@
 		basic_machine=580-amdahl
 		os=-sysv
 		;;
-	amiga | amiga-*)
-		basic_machine=m68k-cbm
-		;;
-	amigaos | amigados)
-		basic_machine=m68k-cbm
+	amiga | amigaos | amigados)
+		basic_machine=powerpc-unknown
 		os=-amigaos
 		;;
 	amigaunix | amix)
-		basic_machine=m68k-cbm
+		basic_machine=m68k-unknown
 		os=-sysv4
 		;;
 	apollo68)
 		basic_machine=m68k-apollo
 		os=-sysv
 		;;
-	apollo68bsd)					# EGCS LOCAL
+	apollo68bsd)
 		basic_machine=m68k-apollo
 		os=-bsd
 		;;
@@ -303,6 +374,10 @@
 		basic_machine=ns32k-sequent
 		os=-dynix
 		;;
+	c90)
+		basic_machine=c90-cray
+		os=-unicos
+		;;
 	convex-c1)
 		basic_machine=c1-convex
 		os=-bsd
@@ -323,27 +398,30 @@
 		basic_machine=c38-convex
 		os=-bsd
 		;;
-	cray | ymp)
-		basic_machine=ymp-cray
-		os=-unicos
-		;;
-	cray2)
-		basic_machine=cray2-cray
-		os=-unicos
-		;;
-	[ctj]90-cray)
-		basic_machine=c90-cray
+	cray | j90)
+		basic_machine=j90-cray
 		os=-unicos
 		;;
 	crds | unos)
 		basic_machine=m68k-crds
 		;;
+	cris | cris-* | etrax*)
+		basic_machine=cris-axis
+		;;
 	da30 | da30-*)
 		basic_machine=m68k-da30
 		;;
 	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
 		basic_machine=mips-dec
 		;;
+	decsystem10* | dec10*)
+		basic_machine=pdp10-dec
+		os=-tops10
+		;;
+	decsystem20* | dec20*)
+		basic_machine=pdp10-dec
+		os=-tops20
+		;;
 	delta | 3300 | motorola-3300 | motorola-delta \
 	      | 3300-motorola | delta-motorola)
 		basic_machine=m68k-motorola
@@ -371,7 +449,7 @@
 	encore | umax | mmax)
 		basic_machine=ns32k-encore
 		;;
-	es1800 | OSE68k | ose68k | ose | OSE)		# EGCS LOCAL
+	es1800 | OSE68k | ose68k | ose | OSE)
 		basic_machine=m68k-ericsson
 		os=-ose
 		;;
@@ -385,6 +463,10 @@
 		basic_machine=tron-gmicro
 		os=-sysv
 		;;
+	go32)
+		basic_machine=i386-pc
+		os=-go32
+		;;
 	h3050r* | hiux*)
 		basic_machine=hppa1.1-hitachi
 		os=-hiuxwe2
@@ -393,11 +475,11 @@
 		basic_machine=h8300-hitachi
 		os=-hms
 		;;
-	h8300xray)					# EGCS LOCAL
+	h8300xray)
 		basic_machine=h8300-hitachi
 		os=-xray
 		;;
-	h8500hms)					# EGCS LOCAL
+	h8500hms)
 		basic_machine=h8500-hitachi
 		os=-hms
 		;;
@@ -416,22 +498,6 @@
 		basic_machine=m68k-hp
 		os=-hpux
 		;;
-        w89k-*)						# EGCS LOCAL
-                basic_machine=hppa1.1-winbond
-                os=-proelf
-                ;;
-        op50n-*)					# EGCS LOCAL
-                basic_machine=hppa1.1-oki
-                os=-proelf
-                ;;
-        op60c-*)					# EGCS LOCAL
-                basic_machine=hppa1.1-oki
-                os=-proelf
-                ;;
-        hppro)						# EGCS LOCAL
-                basic_machine=hppa1.1-hp
-                os=-proelf
-                ;;
 	hp3k9[0-9][0-9] | hp9[0-9][0-9])
 		basic_machine=hppa1.0-hp
 		;;
@@ -441,22 +507,21 @@
 	hp9k3[2-9][0-9])
 		basic_machine=m68k-hp
 		;;
-	hp9k6[0-9][0-9] | hp6[0-9][0-9] )
+	hp9k6[0-9][0-9] | hp6[0-9][0-9])
 		basic_machine=hppa1.0-hp
 		;;
-	hp9k7[0-79][0-9] | hp7[0-79][0-9] )
+	hp9k7[0-79][0-9] | hp7[0-79][0-9])
 		basic_machine=hppa1.1-hp
 		;;
-	hp9k78[0-9] | hp78[0-9] )
+	hp9k78[0-9] | hp78[0-9])
 		# FIXME: really hppa2.0-hp
 		basic_machine=hppa1.1-hp
 		;;
-	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | \
-	hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893 )
+	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
 		# FIXME: really hppa2.0-hp
 		basic_machine=hppa1.1-hp
 		;;
-	hp9k8[0-9][13679] | hp8[0-9][13679] )
+	hp9k8[0-9][13679] | hp8[0-9][13679])
 		basic_machine=hppa1.1-hp
 		;;
 	hp9k8[0-9][0-9] | hp8[0-9][0-9])
@@ -465,47 +530,42 @@
 	hppa-next)
 		os=-nextstep3
 		;;
-	hppaosf)					# EGCS LOCAL
+	hppaosf)
 		basic_machine=hppa1.1-hp
 		os=-osf
 		;;
+	hppro)
+		basic_machine=hppa1.1-hp
+		os=-proelf
+		;;
 	i370-ibm* | ibm*)
 		basic_machine=i370-ibm
-		os=-mvs
 		;;
 # I'm not sure what "Sysv32" means.  Should this be sysv3.2?
-	i[34567]86v32)
+	i*86v32)
 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 		os=-sysv32
 		;;
-	i[34567]86v4*)
+	i*86v4*)
 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 		os=-sysv4
 		;;
-	i[34567]86v)
+	i*86v)
 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 		os=-sysv
 		;;
-	i[34567]86sol2)
+	i*86sol2)
 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 		os=-solaris2
 		;;
-	i386mach)					# EGCS LOCAL
+	i386mach)
 		basic_machine=i386-mach
 		os=-mach
 		;;
-	i386-vsta | vsta)				# EGCS LOCAL
+	i386-vsta | vsta)
 		basic_machine=i386-unknown
 		os=-vsta
 		;;
-	i386-go32 | go32)				# EGCS LOCAL
-		basic_machine=i386-unknown
-		os=-go32
-		;;
-	i386-mingw32 | mingw32)
-		basic_machine=i386-unknown
-		os=-mingw32
-		;;
 	iris | iris4d)
 		basic_machine=mips-sgi
 		case $os in
@@ -531,16 +591,16 @@
 		basic_machine=ns32k-utek
 		os=-sysv
 		;;
+	mingw32)
+		basic_machine=i386-pc
+		os=-mingw32
+		;;
 	miniframe)
 		basic_machine=m68000-convergent
 		;;
-	mipsel*-linux*)
-		basic_machine=mipsel-unknown
-		os=-linux-gnu
-		;;
-	mips*-linux*)
-		basic_machine=mips-unknown
-		os=-linux-gnu
+	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
 		;;
 	mips3*-*)
 		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
@@ -548,24 +608,36 @@
 	mips3*)
 		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
 		;;
-	monitor)					# EGCS LOCAL
+	mmix*)
+		basic_machine=mmix-knuth
+		os=-mmixware
+		;;
+	monitor)
 		basic_machine=m68k-rom68k
 		os=-coff
 		;;
-	msdos)						# EGCS LOCAL
-		basic_machine=i386-unknown	
+	morphos)
+		basic_machine=powerpc-unknown
+		os=-morphos
+		;;
+	msdos)
+		basic_machine=i386-pc
 		os=-msdos
 		;;
+	mvs)
+		basic_machine=i370-ibm
+		os=-mvs
+		;;
 	ncr3000)
 		basic_machine=i486-ncr
 		os=-sysv4
 		;;
 	netbsd386)
-		basic_machine=i386-unknown		# EGCS LOCAL
+		basic_machine=i386-unknown
 		os=-netbsd
 		;;
 	netwinder)
-		basic_machine=armv4l-corel
+		basic_machine=armv4l-rebel
 		os=-linux
 		;;
 	news | news700 | news800 | news900)
@@ -580,7 +652,7 @@
 		basic_machine=mips-sony
 		os=-newsos
 		;;
-	necv70)						# EGCS LOCAL
+	necv70)
 		basic_machine=v70-nec
 		os=-sysv
 		;;
@@ -609,18 +681,33 @@
 		basic_machine=i960-intel
 		os=-nindy
 		;;
-	mon960)						# EGCS LOCAL
+	mon960)
 		basic_machine=i960-intel
 		os=-mon960
 		;;
+	nonstopux)
+		basic_machine=mips-compaq
+		os=-nonstopux
+		;;
 	np1)
 		basic_machine=np1-gould
 		;;
-	OSE68000 | ose68000)				# EGCS LOCAL
+	nsr-tandem)
+		basic_machine=nsr-tandem
+		;;
+	op50n-* | op60c-*)
+		basic_machine=hppa1.1-oki
+		os=-proelf
+		;;
+	or32 | or32-*)
+		basic_machine=or32-unknown
+		os=-coff
+		;;
+	OSE68000 | ose68000)
 		basic_machine=m68000-ericsson
 		os=-ose
 		;;
-	os68k)						# EGCS LOCAL
+	os68k)
 		basic_machine=m68k-none
 		os=-os68k
 		;;
@@ -641,28 +728,28 @@
         pc532 | pc532-*)
 		basic_machine=ns32k-pc532
 		;;
-	pentium | p5 | k5 | k6 | nexen)
+	pentium | p5 | k5 | k6 | nexgen | viac3)
 		basic_machine=i586-pc
 		;;
-	pentiumpro | p6 | 6x86)
+	pentiumpro | p6 | 6x86 | athlon)
 		basic_machine=i686-pc
 		;;
 	pentiumii | pentium2)
-		basic_machine=i786-pc
+		basic_machine=i686-pc
 		;;
-	pentium-* | p5-* | k5-* | k6-* | nexen-*)
+	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
 		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
-	pentiumpro-* | p6-* | 6x86-*)
+	pentiumpro-* | p6-* | 6x86-* | athlon-*)
 		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
 	pentiumii-* | pentium2-*)
-		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
 	pn)
 		basic_machine=pn-gould
 		;;
-	power)	basic_machine=rs6000-ibm
+	power)	basic_machine=power-ibm
 		;;
 	ppc)	basic_machine=powerpc-unknown
 	        ;;
@@ -674,10 +761,24 @@
 	ppcle-* | powerpclittle-*)
 		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
+	ppc64)	basic_machine=powerpc64-unknown
+	        ;;
+	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+		basic_machine=powerpc64le-unknown
+	        ;;
+	ppc64le-* | powerpc64little-*)
+		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
 	ps2)
 		basic_machine=i386-ibm
 		;;
-	rom68k)						# EGCS LOCAL
+	pw32)
+		basic_machine=i586-unknown
+		os=-pw32
+		;;
+	rom68k)
 		basic_machine=m68k-rom68k
 		os=-coff
 		;;
@@ -687,7 +788,13 @@
 	rtpc | rtpc-*)
 		basic_machine=romp-ibm
 		;;
-	sa29200)					# EGCS LOCAL
+	s390 | s390-*)
+		basic_machine=s390-ibm
+		;;
+	s390x | s390x-*)
+		basic_machine=s390x-ibm
+		;;
+	sa29200)
 		basic_machine=a29k-amd
 		os=-udi
 		;;
@@ -698,7 +805,7 @@
 		basic_machine=sh-hitachi
 		os=-hms
 		;;
-	sparclite-wrs)					# EGCS LOCAL
+	sparclite-wrs | simso-wrs)
 		basic_machine=sparclite-wrs
 		os=-vxworks
 		;;
@@ -709,10 +816,10 @@
 	spur)
 		basic_machine=spur-unknown
 		;;
-	st2000)						# EGCS LOCAL
+	st2000)
 		basic_machine=m68k-tandem
 		;;
-	stratus)					# EGCS LOCAL
+	stratus)
 		basic_machine=i860-stratus
 		os=-sysv4
 		;;
@@ -756,16 +863,40 @@
 	sun386 | sun386i | roadrunner)
 		basic_machine=i386-sun
 		;;
+        sv1)
+		basic_machine=sv1-cray
+		os=-unicos
+		;;
 	symmetry)
 		basic_machine=i386-sequent
 		os=-dynix
 		;;
+	t3d)
+		basic_machine=alpha-cray
+		os=-unicos
+		;;
+	t3e)
+		basic_machine=alphaev5-cray
+		os=-unicos
+		;;
+	t90)
+		basic_machine=t90-cray
+		os=-unicos
+		;;
+	tic54x | c54x*)
+		basic_machine=tic54x-unknown
+		os=-coff
+		;;
 	tx39)
 		basic_machine=mipstx39-unknown
 		;;
 	tx39el)
 		basic_machine=mipstx39el-unknown
 		;;
+	toad1)
+		basic_machine=pdp10-xkl
+		os=-tops20
+		;;
 	tower | tower-32)
 		basic_machine=m68k-ncr
 		;;
@@ -777,7 +908,7 @@
 		basic_machine=a29k-nyu
 		os=-sym1
 		;;
-	v810 | necv810)					# EGCS LOCAL
+	v810 | necv810)
 		basic_machine=v810-nec
 		os=-none
 		;;
@@ -804,18 +935,26 @@
 		basic_machine=a29k-wrs
 		os=-vxworks
 		;;
-	w65*)						# EGCS LOCAL
+	w65*)
  		basic_machine=w65-wdc
  		os=-none
 		;;
-	xmp)
-		basic_machine=xmp-cray
-		os=-unicos
+	w89k-*)
+		basic_machine=hppa1.1-winbond
+		os=-proelf
+		;;
+	windows32)
+		basic_machine=i386-pc
+		os=-windows32-msvcrt
 		;;
         xps | xps100)
 		basic_machine=xps100-honeywell
 		;;
-	z8k-*-coff)					# EGCS LOCAL
+	ymp)
+		basic_machine=ymp-cray
+		os=-unicos
+		;;
+	z8k-*-coff)
 		basic_machine=z8k-unknown
 		os=-sim
 		;;
@@ -826,22 +965,15 @@
 
 # Here we handle the default manufacturer of certain CPU types.  It is in
 # some cases the only manufacturer, in others, it is the most popular.
-	w89k)						# EGCS LOCAL
+	w89k)
 		basic_machine=hppa1.1-winbond
 		;;
-	op50n)						# EGCS LOCAL
+	op50n)
 		basic_machine=hppa1.1-oki
 		;;
-	op60c)						# EGCS LOCAL
+	op60c)
 		basic_machine=hppa1.1-oki
 		;;
-	mips)
-		if [ x$os = x-linux-gnu ]; then
-			basic_machine=mips-unknown
-		else
-			basic_machine=mips-mips
-		fi
-		;;
 	romp)
 		basic_machine=romp-ibm
 		;;
@@ -851,13 +983,23 @@
 	vax)
 		basic_machine=vax-dec
 		;;
+	pdp10)
+		# there are many clones, so DEC is not a safe bet
+		basic_machine=pdp10-unknown
+		;;
 	pdp11)
 		basic_machine=pdp11-dec
 		;;
 	we32k)
 		basic_machine=we32k-att
 		;;
-	sparc | sparcv9)
+	sh3 | sh4 | sh3eb | sh4eb)
+		basic_machine=sh-unknown
+		;;
+	sh64)
+		basic_machine=sh64-unknown
+		;;
+	sparc | sparcv9 | sparcv9b)
 		basic_machine=sparc-sun
 		;;
         cydra)
@@ -869,16 +1011,19 @@
 	orion105)
 		basic_machine=clipper-highlevel
 		;;
-	mac | mpw | mac-mpw)				# EGCS LOCAL
+	mac | mpw | mac-mpw)
 		basic_machine=m68k-apple
 		;;
-	pmac | pmac-mpw)				# EGCS LOCAL
+	pmac | pmac-mpw)
 		basic_machine=powerpc-apple
 		;;
  	c4x*)
  		basic_machine=c4x-none
  		os=-coff
   		;;
+	*-unknown)
+		# Make sure to match an already-canonicalized machine name.
+		;;
 	*)
 		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
 		exit 1
@@ -935,20 +1080,35 @@
 	      | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+	      | -chorusos* | -chorusrdb* \
 	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
 	      | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
-	      | -interix* | -uwin* )
+	      | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
+	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* | -powermax*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
-	# EGCS LOCAL
+	-qnx*)
+		case $basic_machine in
+		    x86-* | i*86-*)
+			;;
+		    *)
+			os=-nto$os
+			;;
+		esac
+		;;
+	-nto*)
+		os=-nto-qnx
+		;;
 	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
 	      | -windows* | -osx | -abug |  -netware* | -os9* | -beos* \
-	      | -macos* | -mpw* | -magic* | -mon960* | -lnews* )
+	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
 		;;
 	-mac*)
 		os=`echo $os | sed -e 's|mac|macos|'`
 		;;
-	# END EGCS LOCAL
 	-linux*)
 		os=`echo $os | sed -e 's|linux|linux-gnu|'`
 		;;
@@ -958,6 +1118,12 @@
 	-sunos6*)
 		os=`echo $os | sed -e 's|sunos6|solaris3|'`
 		;;
+	-opened*)
+		os=-openedition
+		;;
+	-wince*)
+		os=-wince
+		;;
 	-osfrose*)
 		os=-osfrose
 		;;
@@ -973,15 +1139,24 @@
 	-acis*)
 		os=-aos
 		;;
-	-386bsd)					# EGCS LOCAL
+	-atheos*)
+		os=-atheos
+		;;
+	-386bsd)
 		os=-bsd
 		;;
 	-ctix* | -uts*)
 		os=-sysv
 		;;
+	-nova*)
+		os=-rtmk-nova
+		;;
 	-ns2 )
 	        os=-nextstep2
 		;;
+	-nsk*)
+		os=-nsk
+		;;
 	# Preserve the version number of sinix5.
 	-sinix5.*)
 		os=`echo $os | sed -e 's|sinix|sysv|'`
@@ -1007,15 +1182,18 @@
 	# This must come after -sysvr4.
 	-sysv*)
 		;;
-	-ose*)						# EGCS LOCAL
+	-ose*)
 		os=-ose
 		;;
-	-es1800*)					# EGCS LOCAL
+	-es1800*)
 		os=-ose
 		;;
 	-xenix)
 		os=-xenix
 		;;
+        -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+	        os=-mint
+		;;
 	-none)
 		;;
 	*)
@@ -1041,12 +1219,16 @@
 	*-acorn)
 		os=-riscix1.2
 		;;
-	arm*-corel)
+	arm*-rebel)
 		os=-linux
 		;;
 	arm*-semi)
 		os=-aout
 		;;
+	# This must come before the *-dec entry.
+	pdp10-*)
+		os=-tops20
+		;;
         pdp11-*)
 		os=-none
 		;;
@@ -1065,15 +1247,18 @@
 		# default.
 		# os=-sunos4
 		;;
-	m68*-cisco)					# EGCS LOCAL
+	m68*-cisco)
 		os=-aout
 		;;
-	mips*-cisco)					# EGCS LOCAL
+	mips*-cisco)
 		os=-elf
 		;;
-        mips*-*)                                        # EGCS LOCAL
+	mips*-*)
                 os=-elf
                 ;;
+	or32-*)
+		os=-coff
+		;;
 	*-tti)	# must be before sparc entry or we get the wrong os.
 		os=-sysv3
 		;;
@@ -1086,13 +1271,13 @@
 	*-ibm)
 		os=-aix
 		;;
-	*-wec)						# EGCS LOCAL
+	*-wec)
 		os=-proelf
 		;;
-	*-winbond)					# EGCS LOCAL
+	*-winbond)
 		os=-proelf
 		;;
-	*-oki)						# EGCS LOCAL
+	*-oki)
 		os=-proelf
 		;;
 	*-hp)
@@ -1155,18 +1340,21 @@
 	*-masscomp)
 		os=-rtu
 		;;
-	f301-fujitsu)
+	f30[01]-fujitsu | f700-fujitsu)
 		os=-uxpv
 		;;
-	*-rom68k)					# EGCS LOCAL
+	*-rom68k)
 		os=-coff
 		;;
-	*-*bug)						# EGCS LOCAL
+	*-*bug)
 		os=-coff
 		;;
-	*-apple)					# EGCS LOCAL
+	*-apple)
 		os=-macos
 		;;
+	*-atari*)
+		os=-mint
+		;;
 	*)
 		os=-none
 		;;
@@ -1212,27 +1400,41 @@
 			-genix*)
 				vendor=ns
 				;;
-			-mvs*)
+			-mvs* | -opened*)
 				vendor=ibm
 				;;
 			-ptx*)
 				vendor=sequent
 				;;
-			-vxsim* | -vxworks*)
+			-vxsim* | -vxworks* | -windiss*)
 				vendor=wrs
 				;;
 			-aux*)
 				vendor=apple
 				;;
-			-hms*)				# EGCS LOCAL
+			-hms*)
 				vendor=hitachi
 				;;
-			-mpw* | -macos*)		# EGCS LOCAL
+			-mpw* | -macos*)
 				vendor=apple
 				;;
+			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+				vendor=atari
+				;;
+			-vos*)
+				vendor=stratus
+				;;
 		esac
 		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
 		;;
 esac
 
 echo $basic_machine$os
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff -urNEBb gcc-2.95.3-orig/configure.in gcc-2.95.3/configure.in
--- gcc-2.95.3-orig/configure.in	1999-06-23 00:44:40.000000000 +0200
+++ gcc-2.95.3/configure.in	2003-12-02 17:50:54.000000000 +0100
@@ -439,7 +439,7 @@
   *) x=${exec_prefix} ;;
   esac
   for l in ${with_libs}; do
-    copy_dirs="$l $x/${target_alias}/lib ${copy_dirs}"
+    echo Skipping lib copy
   done
 fi
 
diff -urNEBb gcc-2.95.3-orig/gcc/#collect2.c# gcc-2.95.3/gcc/#collect2.c#
--- gcc-2.95.3-orig/gcc/#collect2.c#	1970-01-01 01:00:00.000000000 +0100
+++ gcc-2.95.3/gcc/#collect2.c#	2003-12-02 17:50:54.000000000 +0100
@@ -0,0 +1,4310 @@
+/* Collect static initialization info into data structures that can be
+   traversed by C++ initialization and finalization routines.
+   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+   Free Software Foundation, Inc.
+   Contributed by Chris Smith (csmith@convex.com).
+   Heavily modified by Michael Meissner (meissner@cygnus.com),
+   Per Bothner (bothner@cygnus.com), and John Gilmore (gnu@cygnus.com).
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING.  If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+
+/* Build tables of static constructors and destructors and run ld.  */
+
+#include "config.h"
+#include "system.h"
+#include <signal.h>
+
+#ifdef vfork /* Autoconf may define this to fork for us. */
+# define VFORK_STRING "fork"
+#else
+# define VFORK_STRING "vfork"
+#endif
+#ifdef HAVE_VFORK_H
+#include <vfork.h>
+#endif
+#ifdef VMS
+#define vfork() (decc$$alloc_vfork_blocks() >= 0 ? \
+               lib$get_current_invo_context(decc$$get_vfork_jmpbuf()) : -1)
+#endif /* VMS */
+
+#define COLLECT
+
+#include "collect2.h"
+#include "demangle.h"
+#include "obstack.h"
+#include "intl.h"
+
+/* Obstack allocation and deallocation routines.  */
+#define obstack_chunk_alloc xmalloc
+#define obstack_chunk_free free
+
+extern char *make_temp_file PROTO ((char *));
+
+/* On certain systems, we have code that works by scanning the object file
+   directly.  But this code uses system-specific header files and library
+   functions, so turn it off in a cross-compiler.  Likewise, the names of
+   the utilities are not correct for a cross-compiler; we have to hope that
+   cross-versions are in the proper directories.  */
+
+#ifdef CROSS_COMPILE
+#undef SUNOS4_SHARED_LIBRARIES
+#undef OBJECT_FORMAT_COFF
+#undef OBJECT_FORMAT_ROSE
+#undef MD_EXEC_PREFIX
+#undef REAL_LD_FILE_NAME
+#undef REAL_NM_FILE_NAME
+#undef REAL_STRIP_FILE_NAME
+#endif
+
+/* If we cannot use a special method, use the ordinary one:
+   run nm to find what symbols are present.
+   In a cross-compiler, this means you need a cross nm,
+   but that is not quite as unpleasant as special headers.  */
+
+#if !defined (OBJECT_FORMAT_COFF) && !defined (OBJECT_FORMAT_ROSE)
+#define OBJECT_FORMAT_NONE
+#endif
+
+#ifdef OBJECT_FORMAT_COFF
+
+#include <a.out.h>
+#include <ar.h>
+
+#ifdef UMAX
+#include <sgs.h>
+#endif
+
+/* Many versions of ldfcn.h define these.  */
+#ifdef FREAD
+#undef FREAD
+#undef FWRITE
+#endif
+
+#include <ldfcn.h>
+
+/* Some systems have an ISCOFF macro, but others do not.  In some cases
+   the macro may be wrong.  MY_ISCOFF is defined in tm.h files for machines
+   that either do not have an ISCOFF macro in /usr/include or for those 
+   where it is wrong.  */
+
+#ifndef MY_ISCOFF
+#define MY_ISCOFF(X) ISCOFF (X)
+#endif
+
+#endif /* OBJECT_FORMAT_COFF */
+
+#ifdef OBJECT_FORMAT_ROSE
+
+#ifdef _OSF_SOURCE
+#define USE_MMAP
+#endif
+
+#ifdef USE_MMAP
+#include <sys/mman.h>
+#endif
+
+#include <unistd.h>
+#include <mach_o_format.h>
+#include <mach_o_header.h>
+#include <mach_o_vals.h>
+#include <mach_o_types.h>
+
+#endif /* OBJECT_FORMAT_ROSE */
+
+#ifdef OBJECT_FORMAT_NONE
+
+/* Default flags to pass to nm.  */
+#ifndef NM_FLAGS
+#define NM_FLAGS "-n"
+#endif
+
+#endif /* OBJECT_FORMAT_NONE */
+
+/* Some systems use __main in a way incompatible with its use in gcc, in these
+   cases use the macros NAME__MAIN to give a quoted symbol and SYMBOL__MAIN to
+   give the same symbol without quotes for an alternative entry point.  You
+   must define both, or neither.  */
+#ifndef NAME__MAIN
+#define NAME__MAIN "__main"
+#define SYMBOL__MAIN __main
+#endif
+
+/* This must match tree.h.  */
+#define DEFAULT_INIT_PRIORITY 65535
+
+#if defined (LDD_SUFFIX) || SUNOS4_SHARED_LIBRARIES
+#define SCAN_LIBRARIES
+#endif
+
+struct undef_list_node
+{
+	struct undef_list_node *next;
+	char *name;
+	int reported;
+};
+
+struct undef_list_node undef_list = {0, 0};
+
+void empty_undef_list(void);
+void report_undef_list(char **);
+void add_undef_list(char *);
+struct undef_list_node *find_undef_list(char *name);
+
+#ifdef USE_COLLECT2
+int do_collecting = 1;
+#else
+int do_collecting = 0;
+#endif
+
+/* Linked lists of constructor and destructor names.  */
+
+struct id 
+{
+  struct id *next;
+  int sequence;
+  char name[1];
+};
+
+struct head
+{
+  struct id *first;
+  struct id *last;
+  int number;
+};
+
+/* Enumeration giving which pass this is for scanning the program file.  */
+
+enum pass {
+  PASS_FIRST,				/* without constructors */
+  PASS_OBJ,				/* individual objects */
+  PASS_LIB,			        /* looking for shared libraries */
+  PASS_SECOND				/* with constructors linked in */
+};
+
+extern char *version_string;
+
+int vflag;				/* true if -v */
+static int rflag;			/* true if -r */
+static int strip_flag;			/* true if -s */
+#ifdef COLLECT_EXPORT_LIST
+static int export_flag;                 /* true if -bE */
+static int aix64_flag;			/* true if -b64 */
+#endif
+
+int debug;				/* true if -debug */
+
+static int shared_obj;		        /* true if -shared */
+
+static char *c_file;			/* <xxx>.c for constructor/destructor list.  */
+static char *o_file;			/* <xxx>.o for constructor/destructor list.  */
+#ifdef COLLECT_EXPORT_LIST
+static char *export_file;	        /* <xxx>.x for AIX export list.  */
+static char *import_file;	        /* <xxx>.p for AIX import list.  */
+#endif
+char *ldout;				/* File for ld errors.  */
+static char *output_file;		/* Output file for ld.  */
+static char *nm_file_name;		/* pathname of nm */
+#ifdef LDD_SUFFIX
+static char *ldd_file_name;		/* pathname of ldd (or equivalent) */
+#endif
+static char *strip_file_name;		/* pathname of strip */
+char *c_file_name;		        /* pathname of gcc */
+static char *initname, *fininame;	/* names of init and fini funcs */
+
+static struct head constructors;	/* list of constructors found */
+static struct head destructors;		/* list of destructors found */
+#ifdef COLLECT_EXPORT_LIST
+static struct head exports;		/* list of exported symbols */
+static struct head imports;		/* list of imported symbols */
+static struct head undefined;		/* list of undefined symbols */
+#endif
+static struct head frame_tables;	/* list of frame unwind info tables */
+
+struct obstack temporary_obstack;
+struct obstack permanent_obstack;
+char * temporary_firstobj;
+
+/* Holds the return value of pexecute.  */
+int pexecute_pid;
+
+/* Defined in the automatically-generated underscore.c.  */
+extern int prepends_underscore;
+
+extern FILE *fdopen ();
+
+#ifndef GET_ENV_PATH_LIST
+#define GET_ENV_PATH_LIST(VAR,NAME)	do { (VAR) = getenv (NAME); } while (0)
+#endif
+
+/* Structure to hold all the directories in which to search for files to
+   execute.  */
+
+struct prefix_list
+{
+  char *prefix;               /* String to prepend to the path.  */
+  struct prefix_list *next;   /* Next in linked list.  */
+};
+
+struct path_prefix
+{
+  struct prefix_list *plist;  /* List of prefixes to try */
+  int max_len;                /* Max length of a prefix in PLIST */
+  char *name;                 /* Name of this list (used in config stuff) */
+};
+
+#ifdef COLLECT_EXPORT_LIST
+/* Lists to keep libraries to be scanned for global constructors/destructors. */
+static struct head libs;                    /* list of libraries */
+static struct path_prefix cmdline_lib_dirs; /* directories specified with -L */
+static struct path_prefix libpath_lib_dirs; /* directories in LIBPATH */
+static struct path_prefix *libpaths[3] = {&cmdline_lib_dirs,
+					  &libpath_lib_dirs, NULL};
+static char *libexts[3] = {"a", "so", NULL};  /* possible library extentions */
+#endif
+
+void error		PVPROTO((const char *, ...)) ATTRIBUTE_PRINTF_1;
+void fatal		PVPROTO((const char *, ...)) 
+  ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
+void fatal_perror	PVPROTO((const char *, ...))
+  ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
+static char *my_strerror	PROTO((int));
+static const char *my_strsignal	PROTO((int));
+static void handler		PROTO((int));
+static int is_ctor_dtor		PROTO((char *));
+static char *find_a_file	PROTO((struct path_prefix *, char *));
+static void add_prefix		PROTO((struct path_prefix *, char *));
+static void prefix_from_env	PROTO((char *, struct path_prefix *));
+static void prefix_from_string	PROTO((char *, struct path_prefix *));
+static void do_wait		PROTO((char *));
+static void fork_execute	PROTO((char *, char **));
+static void maybe_unlink	PROTO((char *));
+static void add_to_list		PROTO((struct head *, char *));
+static int  extract_init_priority PROTO((char *));
+static void sort_ids		PROTO((struct head *));
+static void write_list		PROTO((FILE *, char *, struct id *));
+#ifdef COLLECT_EXPORT_LIST
+static void dump_list		PROTO((FILE *, char *, struct id *));
+#endif
+#if 0
+static void dump_prefix_list	PROTO((FILE *, char *, struct prefix_list *));
+#endif
+static void write_list_with_asm PROTO((FILE *, char *, struct id *));
+static void write_c_file	PROTO((FILE *, char *));
+static void scan_prog_file	PROTO((char *, enum pass));
+#ifdef SCAN_LIBRARIES
+static void scan_libraries	PROTO((char *));
+#endif
+#ifdef COLLECT_EXPORT_LIST
+static int is_in_list		PROTO((char *, struct id *));
+static void write_export_file	PROTO((FILE *));
+static void write_import_file	PROTO((FILE *));
+static char *resolve_lib_name	PROTO((char *));
+static int use_import_list	PROTO((char *));
+static int ignore_library	PROTO((char *));
+#endif
+
+#ifdef NO_DUP2
+int
+dup2 (oldfd, newfd)
+     int oldfd;
+     int newfd;
+{
+  int fdtmp[256];
+  int fdx = 0;
+  int fd;
+ 
+  if (oldfd == newfd)
+    return oldfd;
+  close (newfd);
+  while ((fd = dup (oldfd)) != newfd && fd >= 0) /* good enough for low fd's */
+    fdtmp[fdx++] = fd;
+  while (fdx > 0)
+    close (fdtmp[--fdx]);
+
+  return fd;
+}
+#endif
+
+static char *
+my_strerror (e)
+     int e;
+{
+
+#ifdef HAVE_STRERROR
+  return strerror (e);
+
+#else
+
+  if (!e)
+    return "";
+
+  if (e > 0 && e < sys_nerr)
+    return sys_errlist[e];
+
+  return "errno = ?";
+#endif
+}
+
+#ifdef __amigaos4__
+#define NSIG SIGTERM
+#define NO_SYS_SIGLIST 
+#endif
+
+static const char *
+my_strsignal (s)
+     int s;
+{
+#ifdef HAVE_STRSIGNAL
+  return strsignal (s);
+#else
+  if (s >= 0 && s < NSIG)
+    {
+# ifdef NO_SYS_SIGLIST
+      static char buffer[30];
+
+      sprintf (buffer, "Unknown signal %d", s);
+      return buffer;
+# else
+      return sys_siglist[s];
+# endif
+    }
+  else
+    return NULL;
+#endif /* HAVE_STRSIGNAL */
+}
+
+/* Delete tempfiles and exit function.  */
+
+void
+collect_exit (status)
+     int status;
+{
+  if (c_file != 0 && c_file[0])
+    maybe_unlink (c_file);
+
+  if (o_file != 0 && o_file[0])
+    maybe_unlink (o_file);
+
+#ifdef COLLECT_EXPORT_LIST
+  if (export_file != 0 && export_file[0])
+    maybe_unlink (export_file);
+
+  if (import_file != 0 && import_file[0])
+    maybe_unlink (import_file);
+#endif
+
+  if (ldout != 0 && ldout[0])
+    {
+      dump_file (ldout);
+      maybe_unlink (ldout);
+    }
+
+  if (status != 0 && output_file != 0 && output_file[0])
+    maybe_unlink (output_file);
+
+  exit (status);
+}
+
+
+/* Notify user of a non-error.  */
+void
+notice VPROTO((char *msgid, ...))
+{
+#ifndef ANSI_PROTOTYPES
+  char *msgid;
+#endif
+  va_list ap;
+
+  VA_START (ap, msgid);
+
+#ifndef ANSI_PROTOTYPES
+  msgid = va_arg (ap, char *);
+#endif
+
+  vfprintf (stderr, _(msgid), ap);
+  va_end (ap);
+}
+
+/* Die when sys call fails.  */
+
+void
+fatal_perror VPROTO((const char * msgid, ...))
+{
+#ifndef ANSI_PROTOTYPES
+  const char *msgid;
+#endif
+  int e = errno;
+  va_list ap;
+
+  VA_START (ap, msgid);
+
+#ifndef ANSI_PROTOTYPES
+  msgid = va_arg (ap, const char *);
+#endif
+
+  fprintf (stderr, "collect2: ");
+  vfprintf (stderr, _(msgid), ap);
+  fprintf (stderr, ": %s\n", my_strerror (e));
+  va_end (ap);
+
+  collect_exit (FATAL_EXIT_CODE);
+}
+
+/* Just die.  */
+
+void
+fatal VPROTO((const char * msgid, ...))
+{
+#ifndef ANSI_PROTOTYPES
+  const char *msgid;
+#endif
+  va_list ap;
+  
+  VA_START (ap, msgid);
+
+#ifndef ANSI_PROTOTYPES
+  msgid = va_arg (ap, const char *);
+#endif
+  
+  fprintf (stderr, "collect2: ");
+  vfprintf (stderr, _(msgid), ap);
+  fprintf (stderr, "\n");
+  va_end (ap);
+
+  collect_exit (FATAL_EXIT_CODE);
+}
+
+/* Write error message.  */
+
+void
+error VPROTO((const char * msgid, ...))
+{
+#ifndef ANSI_PROTOTYPES
+  const char * msgid;
+#endif
+  va_list ap;
+ 
+  VA_START (ap, msgid);
+  
+#ifndef ANSI_PROTOTYPES
+  msgid = va_arg (ap, const char *);
+#endif
+
+  fprintf (stderr, "collect2: ");
+  vfprintf (stderr, _(msgid), ap);
+  fprintf (stderr, "\n");
+  va_end(ap);
+}
+
+/* In case obstack is linked in, and abort is defined to fancy_abort,
+   provide a default entry.  */
+
+void
+fancy_abort ()
+{
+  fatal ("internal error");
+}
+
+static void
+handler (signo)
+     int signo;
+{
+  if (c_file != 0 && c_file[0])
+    maybe_unlink (c_file);
+
+  if (o_file != 0 && o_file[0])
+    maybe_unlink (o_file);
+
+  if (ldout != 0 && ldout[0])
+    maybe_unlink (ldout);
+
+#ifdef COLLECT_EXPORT_LIST
+  if (export_file != 0 && export_file[0])
+    maybe_unlink (export_file);
+
+  if (import_file != 0 && import_file[0])
+    maybe_unlink (import_file);
+#endif
+
+  signal (signo, SIG_DFL);
+  kill (getpid (), signo);
+}
+
+
+PTR
+xcalloc (size1, size2)
+  size_t size1, size2;
+{
+  PTR ptr = (PTR) calloc (size1, size2);
+  if (!ptr)
+    fatal ("out of memory");
+  return ptr;
+}
+
+PTR
+xmalloc (size)
+  size_t size;
+{
+  PTR ptr = (PTR) malloc (size);
+  if (!ptr)
+    fatal ("out of memory");
+  return ptr;
+}
+
+PTR
+xrealloc (old, size)
+  PTR old;
+  size_t size;
+{
+  register PTR ptr;
+  if (old)
+    ptr = (PTR) realloc (old, size);
+  else
+    ptr = (PTR) malloc (size);
+  if (ptr == 0)
+    fatal ("virtual memory exhausted");
+  return ptr;
+}
+
+int
+file_exists (name)
+     char *name;
+{
+  return access (name, R_OK) == 0;
+}
+
+/* Make a copy of a string INPUT with size SIZE.  */
+
+char *
+xstrdup (input)
+  const char *input;
+{
+  register size_t len = strlen (input) + 1;
+  register char *output = xmalloc (len);
+  memcpy (output, input, len);
+  return output;
+}
+
+/* Parse a reasonable subset of shell quoting syntax.  */
+
+static char *
+extract_string (pp)
+     char **pp;
+{
+  char *p = *pp;
+  int backquote = 0;
+  int inside = 0;
+
+  for (;;)
+    {
+      char c = *p;
+      if (c == '\0')
+	break;
+      ++p;
+      if (backquote)
+	obstack_1grow (&temporary_obstack, c);
+      else if (! inside && c == ' ')
+	break;
+      else if (! inside && c == '\\')
+	backquote = 1;
+      else if (c == '\'')
+	inside = !inside;
+      else
+	obstack_1grow (&temporary_obstack, c);
+    }
+
+  obstack_1grow (&temporary_obstack, '\0');
+  *pp = p;
+  return obstack_finish (&temporary_obstack);
+}
+
+void
+dump_file (name)
+     char *name;
+{
+  FILE *stream = fopen (name, "r");
+  int no_demangle = !! getenv ("COLLECT_NO_DEMANGLE");
+
+  if (stream == 0)
+    return;
+  while (1)
+    {
+      int c;
+      while (c = getc (stream),
+	     c != EOF && (ISALNUM (c) || c == '_' || c == '$' || c == '.'))
+	obstack_1grow (&temporary_obstack, c);
+      if (obstack_object_size (&temporary_obstack) > 0)
+	{
+	  char *word, *p, *result;
+	  obstack_1grow (&temporary_obstack, '\0');
+	  word = obstack_finish (&temporary_obstack);
+
+	  if (*word == '.')
+	    ++word, putc ('.', stderr);
+	  p = word;
+	  if (*p == '_' && prepends_underscore)
+	    ++p;
+
+	  if (no_demangle)
+	    result = 0;
+	  else
+	    result = cplus_demangle (p, DMGL_PARAMS | DMGL_ANSI);
+
+	  if (result)
+	    {
+	      int diff;
+	      fputs (result, stderr);
+
+	      diff = strlen (word) - strlen (result);
+	      while (diff > 0)
+		--diff, putc (' ', stderr);
+	      while (diff < 0 && c == ' ')
+		++diff, c = getc (stream);
+
+	      free (result);
+	    }
+	  else
+	    fputs (word, stderr);
+
+	  fflush (stderr);
+	  obstack_free (&temporary_obstack, temporary_firstobj);
+	}
+      if (c == EOF)
+	break;
+      putc (c, stderr);
+    }
+  fclose (stream);
+}
+
+/* Decide whether the given symbol is:
+   a constructor (1), a destructor (2), or neither (0).  */
+
+static int
+is_ctor_dtor (s)
+     char *s;
+{
+  struct names { char *name; int len; int ret; int two_underscores; };
+
+  register struct names *p;
+  register int ch;
+  register char *orig_s = s;
+
+  static struct names special[] = {
+#ifdef NO_DOLLAR_IN_LABEL
+#ifdef NO_DOT_IN_LABEL
+    { "GLOBAL__I_", sizeof ("GLOBAL__I_")-1, 1, 0 },
+    { "GLOBAL__D_", sizeof ("GLOBAL__D_")-1, 2, 0 },
+    { "GLOBAL__F_", sizeof ("GLOBAL__F_")-1, 5, 0 },
+#else
+    { "GLOBAL_.I.", sizeof ("GLOBAL_.I.")-1, 1, 0 },
+    { "GLOBAL_.D.", sizeof ("GLOBAL_.D.")-1, 2, 0 },
+    { "GLOBAL_.F.", sizeof ("GLOBAL_.F.")-1, 5, 0 },
+#endif
+#else
+    { "GLOBAL_$I$", sizeof ("GLOBAL_$I$")-1, 1, 0 },
+    { "GLOBAL_$D$", sizeof ("GLOBAL_$D$")-1, 2, 0 },
+    { "GLOBAL_$F$", sizeof ("GLOBAL_$F$")-1, 5, 0 },
+#endif
+    { "GLOBAL__FI_", sizeof ("GLOBAL__FI_")-1, 3, 0 },
+    { "GLOBAL__FD_", sizeof ("GLOBAL__FD_")-1, 4, 0 },
+#ifdef CFRONT_LOSSAGE /* Do not collect cfront initialization functions.
+			 cfront has its own linker procedure to collect them;
+			 if collect2 gets them too, they get collected twice
+			 when the cfront procedure is run and the compiler used
+			 for linking happens to be GCC.  */
+    { "sti__", sizeof ("sti__")-1, 1, 1 },
+    { "std__", sizeof ("std__")-1, 2, 1 },
+#endif /* CFRONT_LOSSAGE */
+    { NULL, 0, 0, 0 }
+  };
+
+  while ((ch = *s) == '_')
+    ++s;
+
+  if (s == orig_s)
+    return 0;
+
+  for (p = &special[0]; p->len > 0; p++)
+    {
+      if (ch == p->name[0]
+	  && (!p->two_underscores || ((s - orig_s) >= 2))
+	  && strncmp(s, p->name, p->len) == 0)
+	{
+	  return p->ret;
+	}
+    }
+  return 0;
+}
+
+/* Routine to add variables to the environment.  */
+
+#ifndef HAVE_PUTENV
+
+int
+putenv (str)
+     char *str;
+{
+#ifndef VMS			/* nor about VMS */
+
+  extern char **environ;
+  char **old_environ = environ;
+  char **envp;
+  int num_envs = 0;
+  int name_len = 1;
+  char *p = str;
+  int ch;
+
+  while ((ch = *p++) != '\0' && ch != '=')
+    name_len++;
+
+  if (!ch)
+    abort ();
+
+  /* Search for replacing an existing environment variable, and
+     count the number of total environment variables.  */
+  for (envp = old_environ; *envp; envp++)
+    {
+      num_envs++;
+      if (!strncmp (str, *envp, name_len))
+	{
+	  *envp = str;
+	  return 0;
+	}
+    }
+
+  /* Add a new environment variable */
+  environ = (char **) xmalloc (sizeof (char *) * (num_envs+2));
+  *environ = str;
+  bcopy ((char *) old_environ, (char *) (environ + 1),
+	 sizeof (char *) * (num_envs+1));
+
+  return 0;
+#endif	/* VMS */
+}
+
+#endif	/* HAVE_PUTENV */
+
+/* By default, colon separates directories in a path.  */
+#ifndef PATH_SEPARATOR
+#define PATH_SEPARATOR ':'
+#endif
+
+/* We maintain two prefix lists: one from COMPILER_PATH environment variable
+   and one from the PATH variable.  */
+
+static struct path_prefix cpath, path;
+
+#ifdef CROSS_COMPILE
+/* This is the name of the target machine.  We use it to form the name
+   of the files to execute.  */
+
+static char *target_machine = TARGET_MACHINE;
+#endif
+
+/* Search for NAME using prefix list PPREFIX.  We only look for executable
+   files. 
+
+   Return 0 if not found, otherwise return its name, allocated with malloc.  */
+
+static char *
+find_a_file (pprefix, name)
+     struct path_prefix *pprefix;
+     char *name;
+{
+  char *temp;
+  struct prefix_list *pl;
+  int len = pprefix->max_len + strlen (name) + 1;
+
+  if (debug)
+    fprintf (stderr, "Looking for '%s'\n", name);
+  
+#ifdef EXECUTABLE_SUFFIX
+  len += strlen (EXECUTABLE_SUFFIX);
+#endif
+
+  temp = xmalloc (len);
+
+  /* Determine the filename to execute (special case for absolute paths).  */
+
+  if (*name == '/'
+#ifdef HAVE_DOS_BASED_FILE_SYSTEM
+      || (*name && name[1] == ':')
+#endif
+      )
+    {
+      if (access (name, X_OK) == 0)
+	{
+	  strcpy (temp, name);
+
+	  if (debug)
+	    fprintf (stderr, "  - found: absolute path\n");
+	  
+	  return temp;
+	}
+
+#ifdef EXECUTABLE_SUFFIX
+	/* Some systems have a suffix for executable files.
+	   So try appending that.  */
+      strcpy (temp, name);
+	strcat (temp, EXECUTABLE_SUFFIX);
+	
+	if (access (temp, X_OK) == 0)
+	  return temp;
+#endif
+
+      if (debug)
+	fprintf (stderr, "  - failed to locate using absolute path\n");
+    }
+  else
+    for (pl = pprefix->plist; pl; pl = pl->next)
+      {
+	strcpy (temp, pl->prefix);
+	strcat (temp, name);
+	
+	if (access (temp, X_OK) == 0)
+	  return temp;
+
+#ifdef EXECUTABLE_SUFFIX
+	/* Some systems have a suffix for executable files.
+	   So try appending that.  */
+	strcat (temp, EXECUTABLE_SUFFIX);
+	
+	if (access (temp, X_OK) == 0)
+	  return temp;
+#endif
+      }
+
+  if (debug && pprefix->plist == NULL)
+    fprintf (stderr, "  - failed: no entries in prefix list\n");
+
+  free (temp);
+  return 0;
+}
+
+/* Add an entry for PREFIX to prefix list PPREFIX.  */
+
+static void
+add_prefix (pprefix, prefix)
+     struct path_prefix *pprefix;
+     char *prefix;
+{
+  struct prefix_list *pl, **prev;
+  int len;
+
+  if (pprefix->plist)
+    {
+      for (pl = pprefix->plist; pl->next; pl = pl->next)
+	;
+      prev = &pl->next;
+    }
+  else
+    prev = &pprefix->plist;
+
+  /* Keep track of the longest prefix */
+
+  len = strlen (prefix);
+  if (len > pprefix->max_len)
+    pprefix->max_len = len;
+
+  pl = (struct prefix_list *) xmalloc (sizeof (struct prefix_list));
+  pl->prefix = xstrdup (prefix);
+
+  if (*prev)
+    pl->next = *prev;
+  else
+    pl->next = (struct prefix_list *) 0;
+  *prev = pl;
+}
+
+/* Take the value of the environment variable ENV, break it into a path, and
+   add of the entries to PPREFIX.  */
+
+static void
+prefix_from_env (env, pprefix)
+     char *env;
+     struct path_prefix *pprefix;
+{
+  char *p;
+  GET_ENV_PATH_LIST (p, env);
+
+  if (p)
+    prefix_from_string (p, pprefix);
+}
+
+static void
+prefix_from_string (p, pprefix)
+     char *p;
+     struct path_prefix *pprefix;
+{
+  char *startp, *endp;
+  char *nstore = (char *) xmalloc (strlen (p) + 3);
+
+  if (debug)
+    fprintf (stderr, "Convert string '%s' into prefixes, separator = '%c'\n", p, PATH_SEPARATOR);
+  
+  startp = endp = p;
+  while (1)
+    {
+      if (*endp == PATH_SEPARATOR || *endp == 0)
+	{
+	  strncpy (nstore, startp, endp-startp);
+	  if (endp == startp)
+	    {
+	      strcpy (nstore, "./");
+	    }
+	  else if (endp[-1] != '/')
+	    {
+	      nstore[endp-startp] = '/';
+	      nstore[endp-startp+1] = 0;
+	    }
+	  else
+	    nstore[endp-startp] = 0;
+
+	  if (debug)
+	    fprintf (stderr, "  - add prefix: %s\n", nstore);
+	  
+	  add_prefix (pprefix, nstore);
+	  if (*endp == 0)
+	    break;
+	  endp = startp = endp + 1;
+	}
+      else
+	endp++;
+    }
+}
+
+/* Main program.  */
+
+int
+main (argc, argv)
+     int argc;
+     char *argv[];
+{
+  char *ld_suffix	= "ld";
+  char *full_ld_suffix	= ld_suffix;
+  char *real_ld_suffix	= "real-ld";
+  char *collect_ld_suffix = "collect-ld";
+  char *nm_suffix	= "nm";
+  char *full_nm_suffix	= nm_suffix;
+  char *gnm_suffix	= "gnm";
+  char *full_gnm_suffix	= gnm_suffix;
+#ifdef LDD_SUFFIX
+  char *ldd_suffix	= LDD_SUFFIX;
+  char *full_ldd_suffix	= ldd_suffix;
+#endif
+  char *strip_suffix	= "strip";
+  char *full_strip_suffix = strip_suffix;
+  char *gstrip_suffix	= "gstrip";
+  char *full_gstrip_suffix = gstrip_suffix;
+  char *arg;
+  FILE *outf;
+#ifdef COLLECT_EXPORT_LIST
+  FILE *exportf;
+  FILE *importf;
+#endif
+  char *ld_file_name;
+  char *p;
+  char **c_argv;
+  char **c_ptr;
+  char **ld1_argv;
+  char **ld1;
+  char **ld2_argv;
+  char **ld2;
+  char **object_lst;
+  char **object;
+  int first_file;
+  int num_c_args	= argc+9;
+
+#if defined (COLLECT2_HOST_INITIALIZATION)
+  /* Perform system dependant initialization, if neccessary.  */
+  COLLECT2_HOST_INITIALIZATION;
+#endif
+
+#ifdef HAVE_LC_MESSAGES
+  setlocale (LC_MESSAGES, "");
+#endif
+  (void) bindtextdomain (PACKAGE, localedir);
+  (void) textdomain (PACKAGE);
+
+  /* Do not invoke xcalloc before this point, since locale needs to be
+     set first, in case a diagnostic is issued.  */
+
+  ld1 = ld1_argv = (char **) xcalloc (sizeof (char *), argc+3);
+  ld2 = ld2_argv = (char **) xcalloc (sizeof (char *), argc+6);
+  object = object_lst = (char **) xcalloc (sizeof (char *), argc);
+
+#ifdef DEBUG
+  debug = 1;
+#endif
+
+  /* Parse command line early for instances of -debug.  This allows
+     the debug flag to be set before functions like find_a_file()
+     are called.  */
+  {
+    int i;
+    
+    for (i = 1; argv[i] != NULL; i ++)
+      if (! strcmp (argv[i], "-debug"))
+	debug = 1;
+    vflag = debug;
+  }
+
+#ifndef DEFAULT_A_OUT_NAME
+  output_file = "a.out";
+#else
+  output_file = DEFAULT_A_OUT_NAME;
+#endif
+
+  obstack_begin (&temporary_obstack, 0);
+  obstack_begin (&permanent_obstack, 0);
+  temporary_firstobj = (char *) obstack_alloc (&temporary_obstack, 0);
+
+  current_demangling_style = gnu_demangling;
+  p = getenv ("COLLECT_GCC_OPTIONS");
+  while (p && *p)
+    {
+      char *q = extract_string (&p);
+      if (*q == '-' && (q[1] == 'm' || q[1] == 'f'))
+	num_c_args++;
+    }
+  obstack_free (&temporary_obstack, temporary_firstobj);
+  ++num_c_args;
+
+  c_ptr = c_argv = (char **) xcalloc (sizeof (char *), num_c_args);
+
+  if (argc < 2)
+    fatal ("no arguments");
+
+#ifdef SIGQUIT
+  if (signal (SIGQUIT, SIG_IGN) != SIG_IGN)
+    signal (SIGQUIT, handler);
+#endif
+  if (signal (SIGINT, SIG_IGN) != SIG_IGN)
+    signal (SIGINT, handler);
+#ifdef SIGALRM
+  if (signal (SIGALRM, SIG_IGN) != SIG_IGN)
+    signal (SIGALRM, handler);
+#endif
+#ifdef SIGHUP
+  if (signal (SIGHUP, SIG_IGN) != SIG_IGN)
+    signal (SIGHUP, handler);
+#endif
+  if (signal (SIGSEGV, SIG_IGN) != SIG_IGN)
+    signal (SIGSEGV, handler);
+#ifdef SIGBUS
+  if (signal (SIGBUS, SIG_IGN) != SIG_IGN)
+    signal (SIGBUS, handler);
+#endif
+
+  /* Extract COMPILER_PATH and PATH into our prefix list.  */
+  prefix_from_env ("COMPILER_PATH", &cpath);
+  prefix_from_env ("PATH", &path);
+
+#ifdef CROSS_COMPILE
+  /* If we look for a program in the compiler directories, we just use
+     the short name, since these directories are already system-specific.
+     But it we look for a program in the system directories, we need to
+     qualify the program name with the target machine.  */
+
+  full_ld_suffix
+    = xcalloc (strlen (ld_suffix) + strlen (target_machine) + 2, 1);
+  strcpy (full_ld_suffix, target_machine);
+  strcat (full_ld_suffix, "-");
+  strcat (full_ld_suffix, ld_suffix);
+
+#if 0
+  full_gld_suffix
+    = xcalloc (strlen (gld_suffix) + strlen (target_machine) + 2, 1);
+  strcpy (full_gld_suffix, target_machine);
+  strcat (full_gld_suffix, "-");
+  strcat (full_gld_suffix, gld_suffix);
+#endif
+
+  full_nm_suffix
+    = xcalloc (strlen (nm_suffix) + strlen (target_machine) + 2, 1);
+  strcpy (full_nm_suffix, target_machine);
+  strcat (full_nm_suffix, "-");
+  strcat (full_nm_suffix, nm_suffix);
+
+  full_gnm_suffix
+    = xcalloc (strlen (gnm_suffix) + strlen (target_machine) + 2, 1);
+  strcpy (full_gnm_suffix, target_machine);
+  strcat (full_gnm_suffix, "-");
+  strcat (full_gnm_suffix, gnm_suffix);
+
+#ifdef LDD_SUFFIX
+  full_ldd_suffix
+    = xcalloc (strlen (ldd_suffix) + strlen (target_machine) + 2, 1);
+  strcpy (full_ldd_suffix, target_machine);
+  strcat (full_ldd_suffix, "-");
+  strcat (full_ldd_suffix, ldd_suffix);
+#endif
+
+  full_strip_suffix
+    = xcalloc (strlen (strip_suffix) + strlen (target_machine) + 2, 1);
+  strcpy (full_strip_suffix, target_machine);
+  strcat (full_strip_suffix, "-");
+  strcat (full_strip_suffix, strip_suffix);
+  
+  full_gstrip_suffix
+    = xcalloc (strlen (gstrip_suffix) + strlen (target_machine) + 2, 1);
+  strcpy (full_gstrip_suffix, target_machine);
+  strcat (full_gstrip_suffix, "-");
+  strcat (full_gstrip_suffix, gstrip_suffix);
+#endif /* CROSS_COMPILE */
+
+  /* Try to discover a valid linker/nm/strip to use.  */
+
+  /* Maybe we know the right file to use (if not cross).  */
+  ld_file_name = 0;
+#ifdef DEFAULT_LINKER
+  if (access (DEFAULT_LINKER, X_OK) == 0)
+    ld_file_name = DEFAULT_LINKER;
+  if (ld_file_name == 0)
+#endif
+#ifdef REAL_LD_FILE_NAME
+  ld_file_name = find_a_file (&path, REAL_LD_FILE_NAME);
+  if (ld_file_name == 0)
+#endif
+  /* Search the (target-specific) compiler dirs for ld'.  */
+  ld_file_name = find_a_file (&cpath, real_ld_suffix);
+  /* Likewise for `collect-ld'.  */
+  if (ld_file_name == 0)
+    ld_file_name = find_a_file (&cpath, collect_ld_suffix);
+  /* Search the compiler directories for `ld'.  We have protection against
+     recursive calls in find_a_file.  */
+  if (ld_file_name == 0)
+    ld_file_name = find_a_file (&cpath, ld_suffix);
+  /* Search the ordinary system bin directories
+     for `ld' (if native linking) or `TARGET-ld' (if cross).  */
+  if (ld_file_name == 0)
+    ld_file_name = find_a_file (&path, full_ld_suffix);
+
+#ifdef REAL_NM_FILE_NAME
+  nm_file_name = find_a_file (&path, REAL_NM_FILE_NAME);
+  if (nm_file_name == 0)
+#endif
+  nm_file_name = find_a_file (&cpath, gnm_suffix);
+  if (nm_file_name == 0)
+    nm_file_name = find_a_file (&path, full_gnm_suffix);
+  if (nm_file_name == 0)
+    nm_file_name = find_a_file (&cpath, nm_suffix);
+  if (nm_file_name == 0)
+    nm_file_name = find_a_file (&path, full_nm_suffix);
+
+#ifdef LDD_SUFFIX
+  ldd_file_name = find_a_file (&cpath, ldd_suffix);
+  if (ldd_file_name == 0)
+    ldd_file_name = find_a_file (&path, full_ldd_suffix);
+#endif
+
+#ifdef REAL_STRIP_FILE_NAME
+  strip_file_name = find_a_file (&path, REAL_STRIP_FILE_NAME);
+  if (strip_file_name == 0)
+#endif
+  strip_file_name = find_a_file (&cpath, gstrip_suffix);
+  if (strip_file_name == 0)
+    strip_file_name = find_a_file (&path, full_gstrip_suffix);
+  if (strip_file_name == 0)
+    strip_file_name = find_a_file (&cpath, strip_suffix);
+  if (strip_file_name == 0)
+    strip_file_name = find_a_file (&path, full_strip_suffix);
+
+  /* Determine the full path name of the C compiler to use.  */
+  c_file_name = getenv ("COLLECT_GCC");
+  if (c_file_name == 0)
+    {
+#ifdef CROSS_COMPILE
+      c_file_name = xcalloc (sizeof ("gcc-") + strlen (target_machine) + 1, 1);
+      strcpy (c_file_name, target_machine);
+      strcat (c_file_name, "-gcc");
+#else
+      c_file_name = "gcc";
+#endif
+    }
+
+  p = find_a_file (&cpath, c_file_name);
+
+  /* Here it should be safe to use the system search path since we should have
+     already qualified the name of the compiler when it is needed.  */
+  if (p == 0)
+    p = find_a_file (&path, c_file_name);
+
+  if (p)
+    c_file_name = p;
+
+  *ld1++ = *ld2++ = ld_file_name;
+
+  /* Make temp file names.  */
+  c_file = make_temp_file (".c");
+  o_file = make_temp_file (".o");
+#ifdef COLLECT_EXPORT_LIST
+  export_file = make_temp_file (".x");
+  import_file = make_temp_file (".p");
+#endif
+  ldout = make_temp_file (".ld");
+  *c_ptr++ = c_file_name;
+  *c_ptr++ = "-x";
+  *c_ptr++ = "c";
+  *c_ptr++ = "-c";
+  *c_ptr++ = "-o";
+  *c_ptr++ = o_file;
+
+#ifdef COLLECT_EXPORT_LIST
+  /* Generate a list of directories from LIBPATH.  */
+  prefix_from_env ("LIBPATH", &libpath_lib_dirs);
+  /* Add to this list also two standard directories where
+     AIX loader always searches for libraries.  */
+  add_prefix (&libpath_lib_dirs, "/lib");
+  add_prefix (&libpath_lib_dirs, "/usr/lib");
+#endif
+
+  /* Get any options that the upper GCC wants to pass to the sub-GCC.  
+
+     AIX support needs to know if -shared has been specified before
+     parsing commandline arguments.  */
+
+  p = getenv ("COLLECT_GCC_OPTIONS");
+  while (p && *p)
+    {
+      char *q = extract_string (&p);
+      if (*q == '-' && (q[1] == 'm' || q[1] == 'f'))
+	*c_ptr++ = obstack_copy0 (&permanent_obstack, q, strlen (q));
+      if (strcmp (q, "-EL") == 0 || strcmp (q, "-EB") == 0)
+	*c_ptr++ = obstack_copy0 (&permanent_obstack, q, strlen (q));
+      if (strncmp (q, "-shared", sizeof ("-shared") - 1) == 0)
+	shared_obj = 1;
+    }
+  obstack_free (&temporary_obstack, temporary_firstobj);
+  *c_ptr++ = "-fno-exceptions";
+
+  /* !!! When GCC calls collect2,
+     it does not know whether it is calling collect2 or ld.
+     So collect2 cannot meaningfully understand any options
+     except those ld understands.
+     If you propose to make GCC pass some other option,
+     just imagine what will happen if ld is really ld!!!  */
+
+  /* Parse arguments.  Remember output file spec, pass the rest to ld.  */
+  /* After the first file, put in the c++ rt0.  */
+
+  first_file = 1;
+  while ((arg = *++argv) != (char *) 0)
+    {
+      *ld1++ = *ld2++ = arg;
+
+      if (arg[0] == '-')
+	{
+	  switch (arg[1])
+	    {
+#ifdef COLLECT_EXPORT_LIST
+	    /* We want to disable automatic exports on AIX when user
+	       explicitly puts an export list in command line */
+	    case 'b':
+	      if (arg[2] == 'E' || strncmp (&arg[2], "export", 6) == 0)
+                export_flag = 1;
+	      else if (arg[2] == '6' && arg[3] == '4')
+		aix64_flag = 1;
+	      break;
+#endif
+
+	    case 'd':
+	      if (!strcmp (arg, "-debug"))
+		{
+		  /* Already parsed.  */
+		  ld1--;
+		  ld2--;
+		}
+	      break;
+
+	    case 'l':
+	      if (first_file)
+		{
+		  /* place o_file BEFORE this argument! */
+		  first_file = 0;
+		  ld2--;
+		  *ld2++ = o_file;
+		  *ld2++ = arg;
+		}
+#ifdef COLLECT_EXPORT_LIST
+	      {
+	        /* Resolving full library name.  */
+		char *s = resolve_lib_name (arg+2);
+
+		/* If we will use an import list for this library,
+		   we should exclude it from ld args.  */
+		if (use_import_list (s))
+		  {
+		    ld1--;
+		    ld2--;
+		  }
+
+		/* Saving a full library name.  */
+		add_to_list (&libs, s);
+	      }
+#endif
+	      break;
+
+#ifdef COLLECT_EXPORT_LIST
+	    /* Saving directories where to search for libraries.  */
+       	    case 'L':
+	      add_prefix (&cmdline_lib_dirs, arg+2);
+	      break;
+#endif
+
+	    case 'o':
+	      if (arg[2] == '\0')
+		output_file = *ld1++ = *ld2++ = *++argv;
+	      else
+		output_file = &arg[2];
+	      break;
+
+	    case 'r':
+	      if (arg[2] == '\0')
+		rflag = 1;
+	      break;
+
+	    case 's':
+	      if (arg[2] == '\0' && do_collecting)
+		{
+		  /* We must strip after the nm run, otherwise C++ linking
+		     will not work.  Thus we strip in the second ld run, or
+		     else with strip if there is no second ld run.  */
+		  strip_flag = 1;
+		  ld1--;
+		}
+	      break;
+
+	    case 'v':
+	      if (arg[2] == '\0')
+		vflag = 1;
+	      break;
+	    }
+	}
+      else if ((p = rindex (arg, '.')) != (char *) 0
+	       && (strcmp (p, ".o") == 0 || strcmp (p, ".a") == 0
+		   || strcmp (p, ".so") == 0))
+	{
+	  if (first_file)
+	    {
+	      first_file = 0;
+	      if (p[1] == 'o')
+		*ld2++ = o_file;
+	      else
+		{
+		  /* place o_file BEFORE this argument! */
+		  ld2--;
+		  *ld2++ = o_file;
+		  *ld2++ = arg;
+		}
+	    }
+	  if (p[1] == 'o')
+	    *object++ = arg;
+#ifdef COLLECT_EXPORT_LIST
+	  /* libraries can be specified directly, i.e. without -l flag.  */
+       	  else
+       	    { 
+	      /* If we will use an import list for this library,
+		 we should exclude it from ld args.  */
+	      if (use_import_list (arg))
+	        {
+		  ld1--;
+		  ld2--;
+		}
+
+	      /* Saving a full library name.  */
+              add_to_list (&libs, arg);
+            }
+#endif
+	}
+    }
+
+#ifdef COLLECT_EXPORT_LIST
+  /* This is added only for debugging purposes.  */
+  if (debug)
+    {
+      fprintf (stderr, "List of libraries:\n");
+      dump_list (stderr, "\t", libs.first);
+    }
+
+  /* The AIX linker will discard static constructors in object files if
+     nothing else in the file is referenced, so look at them first.  */
+  {
+      char **export_object_lst = object_lst;
+      while (export_object_lst < object)
+	scan_prog_file (*export_object_lst++, PASS_OBJ);
+  }
+  {
+    struct id *list = libs.first;
+    for (; list; list = list->next)
+      scan_prog_file (list->name, PASS_FIRST);
+  }
+  {
+    char *buf1 = alloca (strlen (export_file) + 5);
+    char *buf2 = alloca (strlen (import_file) + 5);
+    sprintf (buf1, "-bE:%s", export_file);
+    sprintf (buf2, "-bI:%s", import_file);
+    *ld1++ = buf1;
+    *ld2++ = buf1;
+    *ld1++ = buf2;
+    *ld2++ = buf2;
+    exportf = fopen (export_file, "w");
+    if (exportf == (FILE *) 0)
+      fatal_perror ("fopen %s", export_file);
+    write_export_file (exportf);
+    if (fclose (exportf))
+      fatal_perror ("fclose %s", export_file);
+    importf = fopen (import_file, "w");
+    if (importf == (FILE *) 0)
+      fatal_perror ("%s", import_file);
+    write_import_file (importf);
+    if (fclose (importf))
+      fatal_perror ("fclose %s", import_file);
+  }
+#endif
+
+  *c_ptr++ = c_file;
+  *object = *c_ptr = *ld1 = (char *) 0;
+
+  if (vflag)
+    {
+      notice ("collect2 version %s", version_string);
+#ifdef TARGET_VERSION
+      TARGET_VERSION;
+#endif
+      fprintf (stderr, "\n");
+    }
+
+  if (debug)
+    {
+      char *ptr;
+      fprintf (stderr, "ld_file_name        = %s\n",
+	       (ld_file_name ? ld_file_name : "not found"));
+      fprintf (stderr, "c_file_name         = %s\n",
+	       (c_file_name ? c_file_name : "not found"));
+      fprintf (stderr, "nm_file_name        = %s\n",
+	       (nm_file_name ? nm_file_name : "not found"));
+#ifdef LDD_SUFFIX
+      fprintf (stderr, "ldd_file_name       = %s\n",
+	       (ldd_file_name ? ldd_file_name : "not found"));
+#endif
+      fprintf (stderr, "strip_file_name     = %s\n",
+	       (strip_file_name ? strip_file_name : "not found"));
+      fprintf (stderr, "c_file              = %s\n",
+	       (c_file ? c_file : "not found"));
+      fprintf (stderr, "o_file              = %s\n",
+	       (o_file ? o_file : "not found"));
+
+      ptr = getenv ("COLLECT_GCC_OPTIONS");
+      if (ptr)
+	fprintf (stderr, "COLLECT_GCC_OPTIONS = %s\n", ptr);
+
+      ptr = getenv ("COLLECT_GCC");
+      if (ptr)
+	fprintf (stderr, "COLLECT_GCC         = %s\n", ptr);
+
+      ptr = getenv ("COMPILER_PATH");
+      if (ptr)
+	fprintf (stderr, "COMPILER_PATH       = %s\n", ptr);
+
+      ptr = getenv ("LIBRARY_PATH");
+      if (ptr)
+	fprintf (stderr, "LIBRARY_PATH        = %s\n", ptr);
+
+      fprintf (stderr, "\n");
+
+    }
+
+  /* Load the program, searching all libraries and attempting to provide
+     undefined symbols from repository information.  */
+
+  /* On AIX we do this later.  */
+#ifndef COLLECT_EXPORT_LIST
+  do_tlink (ld1_argv, object_lst);
+#endif
+
+  /* If -r or they will be run via some other method, do not build the
+     constructor or destructor list, just return now.  */
+  if (rflag
+#ifndef COLLECT_EXPORT_LIST
+      || ! do_collecting
+#endif
+      )
+    {
+#ifdef COLLECT_EXPORT_LIST
+      /* Do the link we avoided above if we are exiting.  */
+      do_tlink (ld1_argv, object_lst);
+
+      /* But make sure we delete the export file we may have created.  */
+      if (export_file != 0 && export_file[0])
+	maybe_unlink (export_file);
+      if (import_file != 0 && import_file[0])
+	maybe_unlink (import_file);
+#endif
+      maybe_unlink (c_file);
+      maybe_unlink (o_file);
+      return 0;
+    }
+
+  /* Examine the namelist with nm and search it for static constructors
+     and destructors to call.
+     Write the constructor and destructor tables to a .s file and reload.  */
+
+  /* On AIX we already done scanning for global constructors/destructors.  */
+#ifndef COLLECT_EXPORT_LIST
+  empty_undef_list();
+  scan_prog_file (output_file, PASS_FIRST);
+  report_undef_list(object_lst);
+#endif
+
+#ifdef SCAN_LIBRARIES
+  scan_libraries (output_file);
+#endif
+
+  if (debug)
+    {
+      notice ("%d constructor(s) found\n", constructors.number);
+      notice ("%d destructor(s)  found\n", destructors.number);
+      notice ("%d frame table(s) found\n", frame_tables.number);
+    }
+
+  if (constructors.number == 0 && destructors.number == 0
+      && frame_tables.number == 0
+#if defined (SCAN_LIBRARIES) || defined (COLLECT_EXPORT_LIST)
+      /* If we will be running these functions ourselves, we want to emit
+	 stubs into the shared library so that we do not have to relink
+	 dependent programs when we add static objects.  */
+      && ! shared_obj
+#endif
+      )
+    {
+#ifdef COLLECT_EXPORT_LIST
+      /* Doing tlink without additional code generation */
+      do_tlink (ld1_argv, object_lst);
+#endif
+      /* Strip now if it was requested on the command line.  */
+      if (strip_flag)
+	{
+	  char **strip_argv = (char **) xcalloc (sizeof (char *), 5);
+	  strip_argv[0] = strip_file_name;
+	  strip_argv[1] = "--strip-debug";
+	  strip_argv[2] = "--strip-unneeded";
+	  strip_argv[3] = output_file;
+	  strip_argv[4] = (char *) 0;
+	  fork_execute ("strip", strip_argv);
+	}
+
+#ifdef COLLECT_EXPORT_LIST
+      maybe_unlink (export_file);
+      maybe_unlink (import_file);
+#endif
+      maybe_unlink (c_file);
+      maybe_unlink (o_file);
+      return 0;
+    }
+
+  /* Sort ctor and dtor lists by priority. */
+  sort_ids (&constructors);
+  sort_ids (&destructors);
+
+  maybe_unlink(output_file);
+  outf = fopen (c_file, "w");
+  if (outf == (FILE *) 0)
+    fatal_perror ("fopen %s", c_file);
+
+  write_c_file (outf, c_file);
+
+  if (fclose (outf))
+    fatal_perror ("fclose %s", c_file);
+
+  /* Tell the linker that we have initializer and finalizer functions.  */
+#ifdef LD_INIT_SWITCH
+  *ld2++ = LD_INIT_SWITCH;
+  *ld2++ = initname;
+  *ld2++ = LD_FINI_SWITCH;
+  *ld2++ = fininame;
+#endif
+  *ld2 = (char*) 0;
+
+#ifdef COLLECT_EXPORT_LIST
+  if (shared_obj)
+    {
+      add_to_list (&exports, initname);
+      add_to_list (&exports, fininame);
+      add_to_list (&exports, "_GLOBAL__DI");
+      add_to_list (&exports, "_GLOBAL__DD");
+      exportf = fopen (export_file, "w");
+      if (exportf == (FILE *) 0)
+	fatal_perror ("fopen %s", export_file);
+      write_export_file (exportf);
+      if (fclose (exportf))
+	fatal_perror ("fclose %s", export_file);
+    }
+#endif
+
+  if (debug)
+    {
+      fprintf (stderr, "\n========== output_file = %s, c_file = %s\n",
+	       output_file, c_file);
+      write_c_file (stderr, "stderr");
+      fprintf (stderr, "========== end of c_file\n\n");
+#ifdef COLLECT_EXPORT_LIST
+      fprintf (stderr, "\n========== export_file = %s\n", export_file);
+      write_export_file (stderr);
+      fprintf (stderr, "========== end of export_file\n\n");
+#endif
+    }
+
+  /* Assemble the constructor and destructor tables.
+     Link the tables in with the rest of the program.  */
+
+  fork_execute ("gcc",  c_argv);
+#ifdef COLLECT_EXPORT_LIST
+  /* On AIX we must call tlink because of possible templates resolution */
+  do_tlink (ld2_argv, object_lst);
+#else
+  /* Otherwise, simply call ld because tlink is already done */
+  fork_execute ("ld", ld2_argv);
+
+  /* Let scan_prog_file do any final mods (OSF/rose needs this for
+     constructors/destructors in shared libraries.  */
+  scan_prog_file (output_file, PASS_SECOND);
+#endif 
+
+  maybe_unlink (c_file);
+  maybe_unlink (o_file);
+
+#ifdef COLLECT_EXPORT_LIST
+  maybe_unlink (export_file);
+  maybe_unlink (import_file);
+#endif
+
+  return 0;
+}
+
+
+/* Wait for a process to finish, and exit if a non-zero status is found.  */
+
+int
+collect_wait (prog)
+     char *prog;
+{
+  int status;
+
+  pwait (pexecute_pid, &status, 0);
+  if (status)
+    {
+      if (WIFSIGNALED (status))
+	{
+	  int sig = WTERMSIG (status);
+	  error ((status & 0200
+		  ? "%s terminated with signal %d [%s]"
+		  : "%s terminated with signal %d [%s], core dumped"),
+		 prog,
+		 sig,
+		 my_strsignal(sig));
+	  collect_exit (FATAL_EXIT_CODE);
+	}
+
+      if (WIFEXITED (status))
+	return WEXITSTATUS (status);
+    }
+  return 0;
+}
+
+static void
+do_wait (prog)
+     char *prog;
+{
+  int ret = collect_wait (prog);
+  if (ret != 0)
+    {
+      error ("%s returned %d exit status", prog, ret);
+      collect_exit (ret);
+    }
+}
+
+
+/* Execute a program, and wait for the reply.  */
+
+void
+collect_execute (prog, argv, redir)
+     char *prog;
+     char **argv;
+     char *redir;
+{
+  char *errmsg_fmt;
+  char *errmsg_arg;
+  int redir_handle = -1;
+  int stdout_save = -1;
+  int stderr_save = -1;
+
+  if (vflag || debug)
+    {
+      char **p_argv;
+      char *str;
+
+      if (argv[0])
+	fprintf (stderr, "%s", argv[0]);
+      else
+	notice ("[cannot find %s]", prog);
+
+      for (p_argv = &argv[1]; (str = *p_argv) != (char *) 0; p_argv++)
+	fprintf (stderr, " %s", str);
+
+      fprintf (stderr, "\n");
+    }
+
+  fflush (stdout);
+  fflush (stderr);
+
+  /* If we cannot find a program we need, complain error.  Do this here
+     since we might not end up needing something that we could not find.  */
+
+  if (argv[0] == 0)
+    fatal ("cannot find `%s'", prog);
+
+  if (redir)
+    {
+      /* Open response file.  */
+      redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT);
+
+      /* Duplicate the stdout and stderr file handles
+	 so they can be restored later.  */
+      stdout_save = dup (STDOUT_FILENO);
+      if (stdout_save == -1)
+	fatal_perror ("redirecting stdout: %s", redir);
+      stderr_save = dup (STDERR_FILENO);
+      if (stderr_save == -1)
+	fatal_perror ("redirecting stdout: %s", redir);
+
+      /* Redirect stdout & stderr to our response file.  */
+      dup2 (redir_handle, STDOUT_FILENO);
+      dup2 (redir_handle, STDERR_FILENO);
+    }
+
+  pexecute_pid = pexecute (argv[0], argv, argv[0], NULL,
+			   &errmsg_fmt, &errmsg_arg,
+			   (PEXECUTE_FIRST | PEXECUTE_LAST | PEXECUTE_SEARCH));
+
+  if (redir)
+    {
+      /* Restore stdout and stderr to their previous settings.  */
+      dup2 (stdout_save, STDOUT_FILENO);
+      dup2 (stderr_save, STDERR_FILENO);
+
+      /* Close reponse file.  */
+      close (redir_handle);
+    }
+
+ if (pexecute_pid == -1)
+   fatal_perror (errmsg_fmt, errmsg_arg);
+}
+
+static void
+fork_execute (prog, argv)
+     char *prog;
+     char **argv;
+{
+  collect_execute (prog, argv, NULL);
+  do_wait (prog);
+}
+
+/* Unlink a file unless we are debugging.  */
+
+static void
+maybe_unlink (file)
+     char *file;
+{
+  if (!debug)
+    unlink (file);
+  else
+    notice ("[Leaving %s]\n", file);
+}
+
+
+static long sequence_number = 0;
+
+/* Add a name to a linked list.  */
+
+static void
+add_to_list (head_ptr, name)
+     struct head *head_ptr;
+     char *name;
+{
+  struct id *newid
+    = (struct id *) xcalloc (sizeof (struct id) + strlen (name), 1);
+  struct id *p;
+  strcpy (newid->name, name);
+
+  if (head_ptr->first)
+    head_ptr->last->next = newid;
+  else
+    head_ptr->first = newid;
+
+  /* Check for duplicate symbols.  */
+  for (p = head_ptr->first;
+       strcmp (name, p->name) != 0;
+       p = p->next)
+    ;
+  if (p != newid)
+    {
+      head_ptr->last->next = 0;
+      free (newid);
+      return;
+    }
+
+  newid->sequence = ++sequence_number;
+  head_ptr->last = newid;
+  head_ptr->number++;
+}
+
+/* Grab the init priority number from an init function name that
+   looks like "_GLOBAL_.I.12345.foo".  */
+
+static int
+extract_init_priority (name)
+     char *name;
+{
+  int pos = 0, pri;
+
+  while (name[pos] == '_')
+    ++pos;
+  pos += 10; /* strlen ("GLOBAL__X_") */
+
+  /* Extract init_p number from ctor/dtor name. */
+  pri = atoi (name + pos);
+  return pri ? pri : DEFAULT_INIT_PRIORITY;
+}
+
+/* Insertion sort the ids from ctor/dtor list HEAD_PTR in descending order.
+   ctors will be run from right to left, dtors from left to right.  */
+
+static void
+sort_ids (head_ptr)
+     struct head *head_ptr;
+{
+  /* id holds the current element to insert.  id_next holds the next
+     element to insert.  id_ptr iterates through the already sorted elements
+     looking for the place to insert id.  */
+  struct id *id, *id_next, **id_ptr;
+
+  id = head_ptr->first;
+
+  /* We don't have any sorted elements yet.  */
+  head_ptr->first = NULL;
+
+  for (; id; id = id_next)
+    {
+      id_next = id->next;
+      id->sequence = extract_init_priority (id->name);
+
+      for (id_ptr = &(head_ptr->first); ; id_ptr = &((*id_ptr)->next))
+	if (*id_ptr == NULL
+	    /* If the sequence numbers are the same, we put the id from the
+	       file later on the command line later in the list.  */
+	    || id->sequence > (*id_ptr)->sequence
+	    /* Hack: do lexical compare, too.
+	    || (id->sequence == (*id_ptr)->sequence
+	        && strcmp (id->name, (*id_ptr)->name) > 0) */
+	    )
+	  {
+	    id->next = *id_ptr;
+	    *id_ptr = id;
+	    break;
+	  }
+    }
+
+  /* Now set the sequence numbers properly so write_c_file works.  */
+  for (id = head_ptr->first; id; id = id->next)
+    id->sequence = ++sequence_number;
+}
+
+/* Write: `prefix', the names on list LIST, `suffix'.  */
+
+static void
+write_list (stream, prefix, list)
+     FILE *stream;
+     char *prefix;
+     struct id *list;
+{
+  while (list)
+    {
+      fprintf (stream, "%sx%d,\n", prefix, list->sequence);
+      list = list->next;
+    }
+}
+
+#ifdef COLLECT_EXPORT_LIST
+/* This function is really used only on AIX, but may be useful.  */
+static int
+is_in_list (prefix, list)
+     char *prefix;
+     struct id *list;
+{
+  while (list)
+    {
+      if (!strcmp (prefix, list->name)) return 1;
+      list = list->next;
+    }
+    return 0;
+}
+#endif
+
+/* Added for debugging purpose.  */
+#ifdef COLLECT_EXPORT_LIST
+static void
+dump_list (stream, prefix, list)
+     FILE *stream;
+     char *prefix;
+     struct id *list;
+{
+  while (list)
+    {
+      fprintf (stream, "%s%s,\n", prefix, list->name);
+      list = list->next;
+    }
+}
+#endif
+
+#if 0
+static void
+dump_prefix_list (stream, prefix, list)
+     FILE *stream;
+     char *prefix;
+     struct prefix_list *list;
+{
+  while (list)
+    {
+      fprintf (stream, "%s%s,\n", prefix, list->prefix);
+      list = list->next;
+    }
+}
+#endif
+
+static void
+write_list_with_asm (stream, prefix, list)
+     FILE *stream;
+     char *prefix;
+     struct id *list;
+{
+  while (list)
+    {
+      fprintf (stream, "%sx%d __asm__ (\"%s\");\n",
+	       prefix, list->sequence, list->name);
+      list = list->next;
+    }
+}
+
+/* Write out the constructor and destructor tables statically (for a shared
+   object), along with the functions to execute them.  */
+
+static void
+write_c_file_stat (stream, name)
+     FILE *stream;
+     char *name;
+{
+  char *prefix, *p, *q;
+  int frames = (frame_tables.number > 0);
+
+  /* Figure out name of output_file, stripping off .so version.  */
+  p = rindex (output_file, '/');
+  if (p == 0)
+    p = (char *) output_file;
+  else
+    p++;
+  q = p;
+  while (q)
+    {
+      q = index (q,'.');
+      if (q == 0)
+	{
+	  q = p + strlen (p);
+	  break;
+	}
+      else
+	{
+	  if (strncmp (q, ".so", 3) == 0)
+	    {
+	      q += 3;
+	      break;
+	    }
+	  else
+	    q++;
+	}
+    }
+  /* q points to null at end of the string (or . of the .so version) */
+  prefix = xmalloc (q - p + 1);
+  strncpy (prefix, p, q - p);
+  prefix[q - p] = 0;
+  for (q = prefix; *q; q++)
+    if (!ISALNUM ((unsigned char)*q))
+      *q = '_';
+  if (debug)
+    notice ("\nwrite_c_file - output name is %s, prefix is %s\n",
+	    output_file, prefix);
+
+#define INIT_NAME_FORMAT "_GLOBAL__FI_%s"
+  initname = xmalloc (strlen (prefix) + sizeof (INIT_NAME_FORMAT) - 2);
+  sprintf (initname, INIT_NAME_FORMAT, prefix);
+
+#define FINI_NAME_FORMAT "_GLOBAL__FD_%s"
+  fininame = xmalloc (strlen (prefix) + sizeof (FINI_NAME_FORMAT) - 2);
+  sprintf (fininame, FINI_NAME_FORMAT, prefix);
+
+  free (prefix);
+
+  /* Write the tables as C code  */
+
+  fprintf (stream, "static int count;\n");
+  fprintf (stream, "typedef void entry_pt();\n");
+  write_list_with_asm (stream, "extern entry_pt ", constructors.first);
+
+  if (frames)
+    {
+      write_list_with_asm (stream, "extern void *", frame_tables.first);
+
+      fprintf (stream, "\tstatic void *frame_table[] = {\n");
+      write_list (stream, "\t\t&", frame_tables.first);
+      fprintf (stream, "\t0\n};\n");
+
+      /* This must match what's in frame.h.  */
+      fprintf (stream, "struct object {\n");
+      fprintf (stream, "  void *pc_begin;\n");
+      fprintf (stream, "  void *pc_end;\n");
+      fprintf (stream, "  void *fde_begin;\n");
+      fprintf (stream, "  void *fde_array;\n");
+      fprintf (stream, "  __SIZE_TYPE__ count;\n");
+      fprintf (stream, "  struct object *next;\n");
+      fprintf (stream, "};\n");
+
+      fprintf (stream, "extern void __register_frame_info_table (void *, struct object *);\n");
+      fprintf (stream, "extern void *__deregister_frame_info (void *);\n");
+
+      fprintf (stream, "static void reg_frame () {\n");
+      fprintf (stream, "\tstatic struct object ob;\n");
+      fprintf (stream, "\t__register_frame_info_table (frame_table, &ob);\n");
+      fprintf (stream, "\t}\n");
+
+      fprintf (stream, "static void dereg_frame () {\n");
+      fprintf (stream, "\t__deregister_frame_info (frame_table);\n");
+      fprintf (stream, "\t}\n");
+    }
+
+  fprintf (stream, "void %s() {\n", initname);
+  if (constructors.number > 0 || frames)
+    {
+      fprintf (stream, "\tstatic entry_pt *ctors[] = {\n");
+      write_list (stream, "\t\t", constructors.first);
+      if (frames)
+	fprintf (stream, "\treg_frame,\n");
+      fprintf (stream, "\t};\n");
+      fprintf (stream, "\tentry_pt **p;\n");
+      fprintf (stream, "\tif (count++ != 0) return;\n");
+      fprintf (stream, "\tp = ctors + %d;\n", constructors.number + frames);
+      fprintf (stream, "\twhile (p > ctors) (*--p)();\n");
+    }
+  else
+    fprintf (stream, "\t++count;\n");
+  fprintf (stream, "}\n");
+  write_list_with_asm (stream, "extern entry_pt ", destructors.first);
+  fprintf (stream, "void %s() {\n", fininame);
+  if (destructors.number > 0 || frames)
+    {
+      fprintf (stream, "\tstatic entry_pt *dtors[] = {\n");
+      write_list (stream, "\t\t", destructors.first);
+      if (frames)
+	fprintf (stream, "\tdereg_frame,\n");
+      fprintf (stream, "\t};\n");
+      fprintf (stream, "\tentry_pt **p;\n");
+      fprintf (stream, "\tif (--count != 0) return;\n");
+      fprintf (stream, "\tp = dtors;\n");
+      fprintf (stream, "\twhile (p < dtors + %d) (*p++)();\n",
+	       destructors.number + frames);
+    }
+  fprintf (stream, "}\n");
+
+  if (shared_obj)
+    {
+      fprintf (stream, "void _GLOBAL__DI() {\n\t%s();\n}\n", initname);
+      fprintf (stream, "void _GLOBAL__DD() {\n\t%s();\n}\n", fininame);
+    }
+}
+
+/* Write the constructor/destructor tables.  */
+
+#ifndef LD_INIT_SWITCH
+static void
+write_c_file_glob (stream, name)
+     FILE *stream;
+     char *name;
+{
+  /* Write the tables as C code  */
+
+  int frames = (frame_tables.number > 0);
+
+  fprintf (stream, "typedef void entry_pt();\n\n");
+    
+  write_list_with_asm (stream, "extern entry_pt ", constructors.first);
+
+  if (frames)
+    {
+      write_list_with_asm (stream, "extern void *", frame_tables.first);
+
+      fprintf (stream, "\tstatic void *frame_table[] = {\n");
+      write_list (stream, "\t\t&", frame_tables.first);
+      fprintf (stream, "\t0\n};\n");
+
+      /* This must match what's in frame.h.  */
+      fprintf (stream, "struct object {\n");
+      fprintf (stream, "  void *pc_begin;\n");
+      fprintf (stream, "  void *pc_end;\n");
+      fprintf (stream, "  void *fde_begin;\n");
+      fprintf (stream, "  void *fde_array;\n");
+      fprintf (stream, "  __SIZE_TYPE__ count;\n");
+      fprintf (stream, "  struct object *next;\n");
+      fprintf (stream, "};\n");
+
+      fprintf (stream, "extern void __register_frame_info_table (void *, struct object *);\n");
+      fprintf (stream, "extern void *__deregister_frame_info (void *);\n");
+
+      fprintf (stream, "static void reg_frame () {\n");
+      fprintf (stream, "\tstatic struct object ob;\n");
+      fprintf (stream, "\t__register_frame_info_table (frame_table, &ob);\n");
+      fprintf (stream, "\t}\n");
+
+      fprintf (stream, "static void dereg_frame () {\n");
+      fprintf (stream, "\t__deregister_frame_info (frame_table);\n");
+      fprintf (stream, "\t}\n");
+    }
+
+  fprintf (stream, "\nentry_pt * __CTOR_LIST__[] = {\n");
+  fprintf (stream, "\t(entry_pt *) %d,\n", constructors.number + frames);
+  write_list (stream, "\t", constructors.first);
+  if (frames)
+    fprintf (stream, "\treg_frame,\n");
+  fprintf (stream, "\t0\n};\n\n");
+
+  write_list_with_asm (stream, "extern entry_pt ", destructors.first);
+
+  fprintf (stream, "\nentry_pt * __DTOR_LIST__[] = {\n");
+  fprintf (stream, "\t(entry_pt *) %d,\n", destructors.number + frames);
+  write_list (stream, "\t", destructors.first);
+  if (frames)
+    fprintf (stream, "\tdereg_frame,\n");
+  fprintf (stream, "\t0\n};\n\n");
+
+  fprintf (stream, "extern entry_pt %s;\n", NAME__MAIN);
+  fprintf (stream, "entry_pt *__main_reference = %s;\n\n", NAME__MAIN);
+}
+#endif /* ! LD_INIT_SWITCH */
+
+static void
+write_c_file (stream, name)
+     FILE *stream;
+     char *name;
+{
+  fprintf (stream, "#ifdef __cplusplus\nextern \"C\" {\n#endif\n");
+#ifndef LD_INIT_SWITCH
+  if (! shared_obj)
+    write_c_file_glob (stream, name);
+  else
+#endif
+    write_c_file_stat (stream, name);
+  fprintf (stream, "#ifdef __cplusplus\n}\n#endif\n");
+}
+
+#ifdef COLLECT_EXPORT_LIST
+static void
+write_export_file (stream)
+     FILE *stream;
+{
+  struct id *list = exports.first;
+  for (; list; list = list->next)
+    fprintf (stream, "%s\n", list->name);
+}
+
+static void
+write_import_file (stream)
+     FILE *stream;
+{
+  struct id *list = imports.first;
+  fprintf (stream, "%s\n", "#! .");
+  for (; list; list = list->next)
+    fprintf (stream, "%s\n", list->name);
+}
+#endif
+
+#ifdef OBJECT_FORMAT_NONE
+
+/* Generic version to scan the name list of the loaded program for
+   the symbols g++ uses for static constructors and destructors.
+
+   The constructor table begins at __CTOR_LIST__ and contains a count
+   of the number of pointers (or -1 if the constructors are built in a
+   separate section by the linker), followed by the pointers to the
+   constructor functions, terminated with a null pointer.  The
+   destructor table has the same format, and begins at __DTOR_LIST__.  */
+#ifndef __amigaos4__
+static void
+scan_prog_file (prog_name, which_pass)
+     char *prog_name;
+     enum pass which_pass;
+{
+  void (*int_handler) ();
+  void (*quit_handler) ();
+  char *nm_argv[4];
+  int pid;
+  int argc = 0;
+  int pipe_fd[2];
+  char *p, buf[1024];
+  FILE *inf;
+
+  if (which_pass == PASS_SECOND)
+    return;
+
+  /* If we do not have an `nm', complain.  */
+  if (nm_file_name == 0)
+    fatal ("cannot find `nm'");
+
+  nm_argv[argc++] = nm_file_name;
+  if (NM_FLAGS[0] != '\0')
+    nm_argv[argc++] = NM_FLAGS;
+
+  nm_argv[argc++] = prog_name;
+  nm_argv[argc++] = (char *) 0;
+
+  if (pipe (pipe_fd) < 0)
+    fatal_perror ("pipe");
+
+  inf = fdopen (pipe_fd[0], "r");
+  if (inf == (FILE *) 0)
+    fatal_perror ("fdopen");
+
+  /* Trace if needed.  */
+  if (vflag)
+    {
+      char **p_argv;
+      char *str;
+
+      for (p_argv = &nm_argv[0]; (str = *p_argv) != (char *) 0; p_argv++)
+	fprintf (stderr, " %s", str);
+
+      fprintf (stderr, "\n");
+    }
+
+  fflush (stdout);
+  fflush (stderr);
+
+  /* Spawn child nm on pipe */
+  pid = vfork ();
+  if (pid == -1)
+    fatal_perror (VFORK_STRING);
+
+  if (pid == 0)			/* child context */
+    {
+      /* setup stdout */
+      if (dup2 (pipe_fd[1], 1) < 0)
+	fatal_perror ("dup2 %d 1", pipe_fd[1]);
+
+      if (close (pipe_fd[0]) < 0)
+	fatal_perror ("close %d", pipe_fd[0]);
+
+      if (close (pipe_fd[1]) < 0)
+	fatal_perror ("close %d", pipe_fd[1]);
+
+      execv (nm_file_name, nm_argv);
+      fatal_perror ("execvp %s", nm_file_name);
+    }
+
+  /* Parent context from here on.  */
+  int_handler  = (void (*) ())signal (SIGINT,  SIG_IGN);
+#ifdef SIGQUIT
+  quit_handler = (void (*) ())signal (SIGQUIT, SIG_IGN);
+#endif
+
+  if (close (pipe_fd[1]) < 0)
+    fatal_perror ("close %d", pipe_fd[1]);
+
+  if (debug)
+    fprintf (stderr, "\nnm output with constructors/destructors.\n");
+
+  /* Read each line of nm output.  */
+  while (fgets (buf, sizeof buf, inf) != (char *) 0)
+    {
+      int ch, ch2;
+      char *name, *end;
+	  
+      /* If it contains a constructor or destructor name, add the name
+	 to the appropriate list.  */
+
+      for (p = buf; (ch = *p) != '\0' && ch != '\n' && ch != '_'; p++)
+	  {
+		  if (ch == ' ' && p[1] == 'U' && p[2] == ' ')
+		  {
+			  /* Undefined symbol... find start and end */
+			  p += 3;
+			  for (end = p; (ch2 = *end) != '\0' && !ISSPACE (ch2) && ch2 != '|'; end++);
+			  *end = 0;
+				  
+			  add_undef_list(p);
+			  if (debug)
+				  fprintf (stderr, "Undefined reference to `%s'\n", p);
+		  }
+	  }
+
+      if (ch != '_')
+	continue;
+  
+      name = p;
+      /* Find the end of the symbol name.
+	 Do not include `|', because Encore nm can tack that on the end.  */
+      for (end = p; (ch2 = *end) != '\0' && !ISSPACE (ch2) && ch2 != '|';
+	   end++)
+	continue;
+
+
+      *end = '\0';
+
+      switch (is_ctor_dtor (name))
+	{
+	case 1:
+	  if (which_pass != PASS_LIB)
+	    add_to_list (&constructors, name);
+	  break;
+
+	case 2:
+	  if (which_pass != PASS_LIB)
+	    add_to_list (&destructors, name);
+	  break;
+
+	case 3:
+	  if (which_pass != PASS_LIB)
+	    fatal ("init function found in object %s", prog_name);
+#ifndef LD_INIT_SWITCH
+	  add_to_list (&constructors, name);
+#endif
+	  break;
+
+	case 4:
+	  if (which_pass != PASS_LIB)
+	    fatal ("fini function found in object %s", prog_name);
+#ifndef LD_FINI_SWITCH
+	  add_to_list (&destructors, name);
+#endif
+	  break;
+
+	case 5:
+	  if (which_pass != PASS_LIB)
+	    add_to_list (&frame_tables, name);
+	  break;
+
+	default:		/* not a constructor or destructor */
+	  continue;
+	}
+
+      if (debug)
+	fprintf (stderr, "\t%s\n", buf);
+    }
+
+  if (debug)
+    fprintf (stderr, "\n");
+
+  if (fclose (inf) != 0)
+    fatal_perror ("fclose");
+
+  do_wait (nm_file_name);
+
+  signal (SIGINT,  int_handler);
+#ifdef SIGQUIT
+  signal (SIGQUIT, quit_handler);
+#endif
+}
+
+#else /* __amigaos4__ */
+
+/* This is the native version */
+
+static void
+scan_prog_file (prog_name, which_pass)
+     char *prog_name;
+     enum pass which_pass;
+{
+  void (*int_handler) ();
+  void (*quit_handler) ();
+  char *nm_argv[4];
+  int pid;
+  int argc = 0;
+  int pipe_fd[2];
+  char *p, buf[1024];
+  FILE *inf;
+  char *scmd,*s;
+  int i, j,len,arglen,c,need_quote;
+
+  if (which_pass == PASS_SECOND)
+    return;
+
+  /* If we do not have an `nm', complain.  */
+  if (nm_file_name == 0)
+    fatal ("cannot find `nm'");
+
+  nm_argv[argc++] = nm_file_name;
+  if (NM_FLAGS[0] != '\0')
+    nm_argv[argc++] = NM_FLAGS;
+
+  nm_argv[argc++] = prog_name;
+  nm_argv[argc++] = (char *) 0;
+
+
+  len = 0;
+
+  for(i = 0 ; nm_argv[i] != NULL ; i++)
+  {
+    arglen = strlen(nm_argv[i]);
+
+    len += 1 + arglen;
+
+    for(j = 0, need_quote = 0 ; j < arglen ; j++)
+    {
+      c = nm_argv[i][j];
+
+      if(c == ' ')
+        need_quote = 1;
+      else if (c == '\"')
+        len++;
+    }
+
+    if(need_quote)
+      len += 2;
+  }
+
+  s = scmd = (char *) xmalloc (len+1);
+
+  for(i = 0 ; nm_argv[i] != NULL ; i++)
+  {
+    arglen = strlen(nm_argv[i]);
+
+    for(j = 0, need_quote = 0 ; j < arglen ; j++)
+    {
+      if(nm_argv[i][j] == ' ')
+        need_quote = 1;
+    }
+
+    if(s != scmd)
+      (*s++) = ' ';
+
+    if(need_quote)
+      (*s++) = '\"';
+
+    for(j = 0 ; j < arglen ; j++)
+    {
+      c = nm_argv[i][j];
+      if(c == '\"')
+        (*s++) = '*';
+
+      (*s++) = c;
+    }
+
+    if(need_quote)
+      (*s++) = '\"';
+  }
+
+  (*s) = '\0';
+
+  /* Trace if needed.  */
+  if (vflag)
+    {
+      char **p_argv;
+      char *str;
+
+      for (p_argv = &nm_argv[0]; (str = *p_argv) != (char *) 0; p_argv++)
+	fprintf (stderr, " %s", str);
+
+      fprintf (stderr, "\n");
+    }
+
+  fflush (stdout);
+  fflush (stderr);
+
+  inf = popen(scmd,"r");
+  if (inf == (FILE *) NULL)
+    fatal_perror ("popen");
+
+  free(scmd);
+
+  if (debug)
+    fprintf (stderr, "\nnm output with constructors/destructors.\n");
+
+  /* Read each line of nm output.  */
+  while (fgets (buf, sizeof buf, inf) != (char *) 0)
+    {
+      int ch, ch2;
+      char *name, *end;
+	  
+      /* If it contains a constructor or destructor name, add the name
+	 to the appropriate list.  */
+
+      for (p = buf; (ch = *p) != '\0' && ch != '\n' && ch != '_'; p++)
+	  {
+		  if (ch == ' ' && p[1] == 'U' && p[2] == ' ')
+		  {
+			  /* Undefined symbol... find start and end */
+			  p += 3;
+			  for (end = p; (ch2 = *end) != '\0' && !ISSPACE (ch2) && ch2 != '|'; end++);
+			  *end = 0;
+				  
+			  add_undef_list(p);
+			  if (debug)
+				  fprintf (stderr, "Undefined reference to `%s'\n", p);
+		  }
+	  }
+
+      if (ch != '_')
+	continue;
+  
+      name = p;
+      /* Find the end of the symbol name.
+	 Do not include `|', because Encore nm can tack that on the end.  */
+      for (end = p; (ch2 = *end) != '\0' && !ISSPACE (ch2) && ch2 != '|';
+	   end++)
+	continue;
+
+
+      *end = '\0';
+
+      switch (is_ctor_dtor (name))
+	{
+	case 1:
+	  if (which_pass != PASS_LIB)
+	    add_to_list (&constructors, name);
+	  break;
+
+	case 2:
+	  if (which_pass != PASS_LIB)
+	    add_to_list (&destructors, name);
+	  break;
+
+	case 3:
+	  if (which_pass != PASS_LIB)
+	    fatal ("init function found in object %s", prog_name);
+#ifndef LD_INIT_SWITCH
+	  add_to_list (&constructors, name);
+#endif
+	  break;
+
+	case 4:
+	  if (which_pass != PASS_LIB)
+	    fatal ("fini function found in object %s", prog_name);
+#ifndef LD_FINI_SWITCH
+	  add_to_list (&destructors, name);
+#endif
+	  break;
+
+	case 5:
+	  if (which_pass != PASS_LIB)
+	    add_to_list (&frame_tables, name);
+	  break;
+
+	default:		/* not a constructor or destructor */
+	  continue;
+	}
+
+      if (debug)
+	fprintf (stderr, "\t%s\n", buf);
+    }
+
+  if (debug)
+    fprintf (stderr, "\n");
+
+  if (fclose (inf) != 0)
+    fatal_perror ("fclose");
+
+  do_wait (nm_file_name);
+
+  signal (SIGINT,  int_handler);
+#ifdef SIGQUIT
+  signal (SIGQUIT, quit_handler);
+#endif
+}
+
+#endif
+#if SUNOS4_SHARED_LIBRARIES
+
+/* Routines to scan the SunOS 4 _DYNAMIC structure to find shared libraries
+   that the output file depends upon and their initialization/finalization
+   routines, if any.  */
+
+#include <a.out.h>
+#include <fcntl.h>
+#include <link.h>
+#include <sys/mman.h>
+#include <sys/param.h>
+#include <unistd.h>
+#include <sys/dir.h>
+
+/* pointers to the object file */
+unsigned object;    	/* address of memory mapped file */
+unsigned objsize;    	/* size of memory mapped to file */
+char * code;		/* pointer to code segment */
+char * data;		/* pointer to data segment */
+struct nlist *symtab;	/* pointer to symbol table */
+struct link_dynamic *ld;
+struct link_dynamic_2 *ld_2;
+struct head libraries;
+
+/* Map the file indicated by NAME into memory and store its address.  */
+
+static void
+mapfile (name)
+     char *name;
+{
+  int fp;
+  struct stat s;
+  if ((fp = open (name, O_RDONLY)) == -1)
+    fatal ("unable to open file '%s'", name);
+  if (fstat (fp, &s) == -1)
+    fatal ("unable to stat file '%s'", name);
+
+  objsize = s.st_size;
+  object = (unsigned) mmap (0, objsize, PROT_READ|PROT_WRITE, MAP_PRIVATE,
+			    fp, 0);
+  if (object == -1)
+    fatal ("unable to mmap file '%s'", name);
+
+  close (fp);
+}
+
+/* Helpers for locatelib.  */
+
+static char *libname;
+
+static int
+libselect (d)
+     struct direct *d;
+{
+  return (strncmp (libname, d->d_name, strlen (libname)) == 0);
+}
+
+/* If one file has an additional numeric extension past LIBNAME, then put
+   that one first in the sort.  If both files have additional numeric
+   extensions, then put the one with the higher number first in the sort.
+
+   We must verify that the extension is numeric, because Sun saves the
+   original versions of patched libraries with a .FCS extension.  Files with
+   invalid extensions must go last in the sort, so that they will not be used.  */
+
+static int
+libcompare (d1, d2)
+     struct direct **d1, **d2;
+{
+  int i1, i2 = strlen (libname);
+  char *e1 = (*d1)->d_name + i2;
+  char *e2 = (*d2)->d_name + i2;
+
+  while (*e1 && *e2 && *e1 == '.' && *e2 == '.'
+	 && e1[1] && ISDIGIT (e1[1]) && e2[1] && ISDIGIT (e2[1]))
+    {
+      ++e1;
+      ++e2;
+      i1 = strtol (e1, &e1, 10);
+      i2 = strtol (e2, &e2, 10);
+      if (i1 != i2)
+	return i1 - i2;
+    }
+
+  if (*e1)
+    {
+      /* It has a valid numeric extension, prefer this one.  */
+      if (*e1 == '.' && e1[1] && ISDIGIT (e1[1]))
+	return 1;
+      /* It has a invalid numeric extension, must prefer the other one.  */
+      else
+	return -1;
+    }
+  else if (*e2)
+    {
+      /* It has a valid numeric extension, prefer this one.  */
+      if (*e2 == '.' && e2[1] && ISDIGIT (e2[1]))
+	return -1;
+      /* It has a invalid numeric extension, must prefer the other one.  */
+      else
+	return 1;
+    }
+  else
+    return 0;
+}
+
+/* Given the name NAME of a dynamic dependency, find its pathname and add
+   it to the list of libraries.  */
+
+static void
+locatelib (name)
+     char *name;
+{
+  static char **l;
+  static int cnt;
+  char buf[MAXPATHLEN];
+  char *p, *q;
+  char **pp;
+
+  if (l == 0)
+    {
+      char *ld_rules;
+      char *ldr = 0;
+      /* counting elements in array, need 1 extra for null */
+      cnt = 1;  
+      ld_rules = (char *) (ld_2->ld_rules + code);
+      if (ld_rules)
+	{
+	  cnt++;
+	  for (; *ld_rules != 0; ld_rules++)
+	    if (*ld_rules == ':')
+	      cnt++;
+	  ld_rules = (char *) (ld_2->ld_rules + code);
+	  ldr = (char *) malloc (strlen (ld_rules) + 1);
+	  strcpy (ldr, ld_rules);
+	}
+      p = getenv ("LD_LIBRARY_PATH");
+      q = 0;
+      if (p)
+	{
+	  cnt++;
+	  for (q = p ; *q != 0; q++)
+	    if (*q == ':')
+	      cnt++;
+	  q = (char *) malloc (strlen (p) + 1);
+	  strcpy (q, p);
+	}
+      l = (char **) malloc ((cnt + 3) * sizeof (char *));
+      pp = l;
+      if (ldr)
+	{
+	  *pp++ = ldr;
+	  for (; *ldr != 0; ldr++) 
+	    if (*ldr == ':')
+	      {
+		*ldr++ = 0;
+		*pp++ = ldr;
+	      }
+	}
+      if (q)
+	{
+	  *pp++ = q;
+	  for (; *q != 0; q++) 
+	    if (*q == ':')
+	      {
+		*q++ = 0;
+		*pp++ = q;
+	      }
+	}
+      /* built in directories are /lib, /usr/lib, and /usr/local/lib */
+      *pp++ = "/lib";
+      *pp++ = "/usr/lib";
+      *pp++ = "/usr/local/lib";
+      *pp = 0;
+    }
+  libname = name;
+  for (pp = l; *pp != 0 ; pp++)
+    {
+      struct direct **namelist;
+      int entries;
+      if ((entries = scandir (*pp, &namelist, libselect, libcompare)) > 0)
+	{
+	  sprintf (buf, "%s/%s", *pp, namelist[entries - 1]->d_name);
+	  add_to_list (&libraries, buf);
+	  if (debug)
+	    fprintf (stderr, "%s\n", buf);
+	  break;
+	}
+    }
+  if (*pp == 0)
+    {
+      if (debug)
+	notice ("not found\n");
+      else
+	fatal ("dynamic dependency %s not found", name);
+    }
+}
+
+/* Scan the _DYNAMIC structure of the output file to find shared libraries
+   that it depends upon and any constructors or destructors they contain.  */
+
+static void 
+scan_libraries (prog_name)
+     char *prog_name;
+{
+  struct exec *header;
+  char *base;
+  struct link_object *lo;
+  char buff[MAXPATHLEN];
+  struct id *list;
+
+  mapfile (prog_name);
+  header = (struct exec *)object;
+  if (N_BADMAG (*header))
+    fatal ("bad magic number in file '%s'", prog_name);
+  if (header->a_dynamic == 0)
+    return;
+
+  code = (char *) (N_TXTOFF (*header) + (long) header);
+  data = (char *) (N_DATOFF (*header) + (long) header);
+  symtab = (struct nlist *) (N_SYMOFF (*header) + (long) header);
+
+  if (header->a_magic == ZMAGIC && header->a_entry == 0x20)
+    {
+      /* shared object */
+      ld = (struct link_dynamic *) (symtab->n_value + code);
+      base = code;
+    }
+  else
+    {
+      /* executable */
+      ld = (struct link_dynamic *) data;
+      base = code-PAGSIZ;
+    }
+
+  if (debug)
+    notice ("dynamic dependencies.\n");
+
+  ld_2 = (struct link_dynamic_2 *) ((long) ld->ld_un.ld_2 + (long)base);
+  for (lo = (struct link_object *) ld_2->ld_need; lo;
+       lo = (struct link_object *) lo->lo_next)
+    {
+      char *name;
+      lo = (struct link_object *) ((long) lo + code);
+      name = (char *) (code + lo->lo_name);
+      if (lo->lo_library)
+	{
+	  if (debug)
+	    fprintf (stderr, "\t-l%s.%d => ", name, lo->lo_major);
+	  sprintf (buff, "lib%s.so.%d.%d", name, lo->lo_major, lo->lo_minor);
+	  locatelib (buff);
+	}
+      else
+	{
+	  if (debug)
+	    fprintf (stderr, "\t%s\n", name);
+	  add_to_list (&libraries, name);
+	}
+    }
+
+  if (debug)
+    fprintf (stderr, "\n");
+
+  /* now iterate through the library list adding their symbols to
+     the list.  */
+  for (list = libraries.first; list; list = list->next)
+    scan_prog_file (list->name, PASS_LIB);
+}
+
+#else  /* SUNOS4_SHARED_LIBRARIES */
+#ifdef LDD_SUFFIX
+
+/* Use the List Dynamic Dependencies program to find shared libraries that
+   the output file depends upon and their initialization/finalization
+   routines, if any.  */
+
+static void 
+scan_libraries (prog_name)
+     char *prog_name;
+{
+  static struct head libraries;		/* list of shared libraries found */
+  struct id *list;
+  void (*int_handler) ();
+  void (*quit_handler) ();
+  char *ldd_argv[4];
+  int pid;
+  int argc = 0;
+  int pipe_fd[2];
+  char buf[1024];
+  FILE *inf;
+
+  /* If we do not have an `ldd', complain.  */
+  if (ldd_file_name == 0)
+    {
+      error ("cannot find `ldd'");
+      return;
+    }
+
+  ldd_argv[argc++] = ldd_file_name;
+  ldd_argv[argc++] = prog_name;
+  ldd_argv[argc++] = (char *) 0;
+
+  if (pipe (pipe_fd) < 0)
+    fatal_perror ("pipe");
+
+  inf = fdopen (pipe_fd[0], "r");
+  if (inf == (FILE *) 0)
+    fatal_perror ("fdopen");
+
+  /* Trace if needed.  */
+  if (vflag)
+    {
+      char **p_argv;
+      char *str;
+
+      for (p_argv = &ldd_argv[0]; (str = *p_argv) != (char *) 0; p_argv++)
+	fprintf (stderr, " %s", str);
+
+      fprintf (stderr, "\n");
+    }
+
+  fflush (stdout);
+  fflush (stderr);
+
+  /* Spawn child ldd on pipe */
+  pid = vfork ();
+  if (pid == -1)
+    fatal_perror (VFORK_STRING);
+
+  if (pid == 0)			/* child context */
+    {
+      /* setup stdout */
+      if (dup2 (pipe_fd[1], 1) < 0)
+	fatal_perror ("dup2 %d 1", pipe_fd[1]);
+
+      if (close (pipe_fd[0]) < 0)
+	fatal_perror ("close %d", pipe_fd[0]);
+
+      if (close (pipe_fd[1]) < 0)
+	fatal_perror ("close %d", pipe_fd[1]);
+
+      execv (ldd_file_name, ldd_argv);
+      fatal_perror ("execv %s", ldd_file_name);
+    }
+
+  /* Parent context from here on.  */
+  int_handler  = (void (*) ()) signal (SIGINT,  SIG_IGN);
+#ifdef SIGQUIT
+  quit_handler = (void (*) ()) signal (SIGQUIT, SIG_IGN);
+#endif
+
+  if (close (pipe_fd[1]) < 0)
+    fatal_perror ("close %d", pipe_fd[1]);
+
+  if (debug)
+    notice ("\nldd output with constructors/destructors.\n");
+
+  /* Read each line of ldd output.  */
+  while (fgets (buf, sizeof buf, inf) != (char *) 0)
+    {
+      int ch, ch2;
+      char *name, *end, *p = buf;
+
+      /* Extract names of libraries and add to list.  */
+      PARSE_LDD_OUTPUT (p);
+      if (p == 0)
+	continue;
+
+      name = p;
+      if (strncmp (name, "not found", sizeof ("not found") - 1) == 0)
+	fatal ("dynamic dependency %s not found", buf);
+
+      /* Find the end of the symbol name.  */
+      for (end = p; 
+	   (ch2 = *end) != '\0' && ch2 != '\n' && !ISSPACE (ch2) && ch2 != '|';
+	   end++)
+	continue;
+      *end = '\0';
+
+      if (access (name, R_OK) == 0)
+        add_to_list (&libraries, name);
+      else
+	fatal ("unable to open dynamic dependency '%s'", buf);
+
+      if (debug)
+	fprintf (stderr, "\t%s\n", buf);
+    }
+  if (debug)
+    fprintf (stderr, "\n");
+
+  if (fclose (inf) != 0)
+    fatal_perror ("fclose");
+
+  do_wait (ldd_file_name);
+
+  signal (SIGINT,  int_handler);
+#ifdef SIGQUIT
+  signal (SIGQUIT, quit_handler);
+#endif
+
+  /* now iterate through the library list adding their symbols to
+     the list.  */
+  for (list = libraries.first; list; list = list->next)
+    scan_prog_file (list->name, PASS_LIB);
+}
+
+#endif /* LDD_SUFFIX */
+#endif /* SUNOS4_SHARED_LIBRARIES */
+
+#endif /* OBJECT_FORMAT_NONE */
+
+
+/*
+ * COFF specific stuff.
+ */
+
+#ifdef OBJECT_FORMAT_COFF
+
+#if defined(EXTENDED_COFF)
+#   define GCC_SYMBOLS(X)	(SYMHEADER(X).isymMax + SYMHEADER(X).iextMax)
+#   define GCC_SYMENT		SYMR
+#   define GCC_OK_SYMBOL(X)	((X).st == stProc || (X).st == stGlobal)
+#   define GCC_SYMINC(X)	(1)
+#   define GCC_SYMZERO(X)	(SYMHEADER(X).isymMax)
+#   define GCC_CHECK_HDR(X)	(PSYMTAB(X) != 0)
+#else
+#   define GCC_SYMBOLS(X)	(HEADER(ldptr).f_nsyms)
+#   define GCC_SYMENT		SYMENT
+#   define GCC_OK_SYMBOL(X) \
+     (((X).n_sclass == C_EXT) && \
+      ((X).n_scnum > N_UNDEF) && \
+      (((X).n_type & N_TMASK) == (DT_NON << N_BTSHFT) || \
+       ((X).n_type & N_TMASK) == (DT_FCN << N_BTSHFT)))
+#   define GCC_UNDEF_SYMBOL(X) \
+     (((X).n_sclass == C_EXT) && ((X).n_scnum == N_UNDEF))
+#   define GCC_SYMINC(X)	((X).n_numaux+1)
+#   define GCC_SYMZERO(X)	0
+#   define GCC_CHECK_HDR(X) \
+     ((HEADER (X).f_magic == U802TOCMAGIC && ! aix64_flag) \
+      || (HEADER (X).f_magic == 0757 && aix64_flag))
+#endif
+
+extern char *ldgetname ();
+
+/* COFF version to scan the name list of the loaded program for
+   the symbols g++ uses for static constructors and destructors.
+
+   The constructor table begins at __CTOR_LIST__ and contains a count
+   of the number of pointers (or -1 if the constructors are built in a
+   separate section by the linker), followed by the pointers to the
+   constructor functions, terminated with a null pointer.  The
+   destructor table has the same format, and begins at __DTOR_LIST__.  */
+
+static void
+scan_prog_file (prog_name, which_pass)
+     char *prog_name;
+     enum pass which_pass;
+{
+  LDFILE *ldptr = NULL;
+  int sym_index, sym_count;
+  int is_shared = 0;
+#ifdef COLLECT_EXPORT_LIST
+  /* Should we generate an import list for given prog_name?  */
+  int import_flag = (which_pass == PASS_OBJ ? 0 : use_import_list (prog_name));
+#endif
+
+  if (which_pass != PASS_FIRST && which_pass != PASS_OBJ)
+    return;
+
+#ifdef COLLECT_EXPORT_LIST
+  /* We do not need scanning for some standard C libraries.  */
+  if (which_pass == PASS_FIRST && ignore_library (prog_name))
+    return;
+
+  /* On AIX we have a loop, because there is not much difference
+     between an object and an archive. This trick allows us to
+     eliminate scan_libraries() function.  */
+  do
+    {
+#endif
+      if ((ldptr = ldopen (prog_name, ldptr)) != NULL)
+	{
+	  if (! MY_ISCOFF (HEADER (ldptr).f_magic))
+	    fatal ("%s: not a COFF file", prog_name);
+
+	  if (GCC_CHECK_HDR (ldptr))
+	    {
+	      sym_count = GCC_SYMBOLS (ldptr);
+	      sym_index = GCC_SYMZERO (ldptr);
+
+#ifdef COLLECT_EXPORT_LIST
+	      /* Is current archive member a shared object?  */
+	      is_shared = HEADER (ldptr).f_flags & F_SHROBJ;
+#endif
+
+	      while (sym_index < sym_count)
+		{
+		  GCC_SYMENT symbol;
+
+		  if (ldtbread (ldptr, sym_index, &symbol) <= 0)
+		    break;
+		  sym_index += GCC_SYMINC (symbol);
+
+		  if (GCC_OK_SYMBOL (symbol))
+		    {
+		      char *name;
+
+		      if ((name = ldgetname (ldptr, &symbol)) == NULL)
+			continue;		/* should never happen */
+
+#ifdef XCOFF_DEBUGGING_INFO
+		      /* All AIX function names have a duplicate entry
+			 beginning with a dot.  */
+		      if (*name == '.')
+			++name;
+#endif
+
+		      switch (is_ctor_dtor (name))
+			{
+			case 1:
+			  if (! is_shared) add_to_list (&constructors, name);
+#ifdef COLLECT_EXPORT_LIST
+			  if (which_pass == PASS_OBJ)
+			    add_to_list (&exports, name);
+			  /* If this symbol was undefined and we are building
+			     an import list, we should add a symbol to this
+			     list.  */
+			  else
+			    if (import_flag
+				&& is_in_list (name, undefined.first))
+			      add_to_list (&imports, name);
+#endif
+			  break;
+
+			case 2:
+			  if (! is_shared) add_to_list (&destructors, name);
+#ifdef COLLECT_EXPORT_LIST
+			  if (which_pass == PASS_OBJ)
+			    add_to_list (&exports, name);
+			  /* If this symbol was undefined and we are building
+			     an import list, we should add a symbol to this
+			     list.  */
+			  else
+			    if (import_flag
+				&& is_in_list (name, undefined.first))
+			      add_to_list (&imports, name);
+#endif
+			  break;
+
+#ifdef COLLECT_EXPORT_LIST
+			case 3:
+			  if (is_shared)
+			    add_to_list (&constructors, name);
+			  break;
+
+			case 4:
+			  if (is_shared)
+			    add_to_list (&destructors, name);
+			  break;
+#endif
+
+			case 5:
+			  if (! is_shared)
+			    add_to_list (&frame_tables, name);
+			  break;
+
+			default:	/* not a constructor or destructor */
+#ifdef COLLECT_EXPORT_LIST
+			  /* If we are building a shared object on AIX we need
+			     to explicitly export all global symbols or add
+			     them to import list.  */
+			  if (shared_obj) 
+			    {
+			      if (which_pass == PASS_OBJ && (! export_flag))
+				add_to_list (&exports, name);
+			      else if (! is_shared && which_pass == PASS_FIRST
+				       && import_flag
+				       && is_in_list(name, undefined.first))
+				add_to_list (&imports, name);
+			    }
+#endif
+			  continue;
+			}
+
+#if !defined(EXTENDED_COFF)
+		      if (debug)
+			fprintf (stderr, "\tsec=%d class=%d type=%s%o %s\n",
+				 symbol.n_scnum, symbol.n_sclass,
+				 (symbol.n_type ? "0" : ""), symbol.n_type,
+				 name);
+#else
+		      if (debug)
+			fprintf (stderr,
+				 "\tiss = %5d, value = %5ld, index = %5d, name = %s\n",
+				 symbol.iss, (long) symbol.value, symbol.index, name);
+#endif
+		    }
+#ifdef COLLECT_EXPORT_LIST
+		  /* If we are building a shared object we should collect
+		     information about undefined symbols for later
+		     import list generation.  */
+		  else if (shared_obj && GCC_UNDEF_SYMBOL (symbol))
+		    {
+		      char *name;
+
+		      if ((name = ldgetname (ldptr, &symbol)) == NULL)
+			continue;		/* should never happen */
+
+		      /* All AIX function names have a duplicate entry
+			 beginning with a dot.  */
+		      if (*name == '.')
+			++name;
+		      add_to_list (&undefined, name);
+		    }
+#endif
+		}
+	    }
+#ifdef COLLECT_EXPORT_LIST
+	  else
+	    {
+	      /* If archive contains both 32-bit and 64-bit objects,
+		 we want to skip objects in other mode so mismatch normal.  */
+	      if (debug)
+		fprintf (stderr, "%s : magic=%o aix64=%d mismatch\n",
+			 prog_name, HEADER (ldptr).f_magic, aix64_flag);
+	    }
+#endif
+	}
+      else
+	{
+	  fatal ("%s: cannot open as COFF file", prog_name);
+	}
+#ifdef COLLECT_EXPORT_LIST
+      /* On AIX loop continues while there are more members in archive.  */
+    }
+  while (ldclose (ldptr) == FAILURE);
+#else
+  /* Otherwise we simply close ldptr.  */
+  (void) ldclose(ldptr);
+#endif
+}
+
+
+#ifdef COLLECT_EXPORT_LIST
+
+/* Never generate import list (gcc-2.95 branch).  */
+static int
+use_import_list (prog_name)
+     char *prog_name;
+{
+  return 0;
+}
+
+/* Given a library name without "lib" prefix, this function
+   returns a full library name including a path.  */
+static char *
+resolve_lib_name (name)
+     char *name;
+{
+  char *lib_buf;
+  int i, j, l = 0;
+
+  for (i = 0; libpaths[i]; i++)
+    if (libpaths[i]->max_len > l)
+      l = libpaths[i]->max_len;
+
+  lib_buf = xmalloc (l + strlen(name) + 10);
+
+  for (i = 0; libpaths[i]; i++)
+    {
+      struct prefix_list *list = libpaths[i]->plist;
+      for (; list; list = list->next)
+	{
+	  for (j = 0; libexts[j]; j++)
+	    {
+              /* The following lines are needed because path_prefix list
+                 may contain directories both with trailing '/' and
+                 without it.  */
+              char *p = "";
+              if (list->prefix[strlen(list->prefix)-1] != '/')
+                p = "/";
+       	      sprintf (lib_buf, "%s%slib%s.%s",
+		       list->prefix, p, name, libexts[j]);
+if (debug) fprintf (stderr, "searching for: %s\n", lib_buf);
+	      if (file_exists (lib_buf))
+		{
+if (debug) fprintf (stderr, "found: %s\n", lib_buf);
+		  return (lib_buf);
+		}
+	    }
+	}
+    }
+  if (debug)
+    fprintf (stderr, "not found\n");
+  else
+    fatal ("Library lib%s not found", name);
+  return (NULL);
+}
+
+/* Array of standard AIX libraries which should not
+   be scanned for ctors/dtors.  */
+static char* aix_std_libs[] = {
+  "/unix",
+  "/lib/libc.a",
+  "/lib/libc_r.a",
+  "/usr/lib/libc.a",
+  "/usr/lib/libc_r.a",
+  "/usr/lib/threads/libc.a",
+  "/usr/ccs/lib/libc.a",
+  "/usr/ccs/lib/libc_r.a",
+  NULL
+};
+
+/* This function checks the filename and returns 1
+   if this name matches the location of a standard AIX library. */
+static int
+ignore_library (name)
+     char *name;
+{
+  char **p = &aix_std_libs[0];
+  while (*p++ != NULL)
+    if (! strcmp (name, *p)) return 1;
+  return 0;
+}
+
+#endif
+
+#endif /* OBJECT_FORMAT_COFF */
+
+
+/*
+ * OSF/rose specific stuff.
+ */
+
+#ifdef OBJECT_FORMAT_ROSE
+
+/* Union of the various load commands */
+
+typedef union load_union
+{
+  ldc_header_t			hdr;	/* common header */
+  load_cmd_map_command_t	map;	/* map indexing other load cmds */
+  interpreter_command_t		iprtr;	/* interpreter pathname */
+  strings_command_t		str;	/* load commands strings section */
+  region_command_t		region;	/* region load command */
+  reloc_command_t		reloc;	/* relocation section */
+  package_command_t		pkg;	/* package load command */
+  symbols_command_t		sym;	/* symbol sections */
+  entry_command_t		ent;	/* program start section */
+  gen_info_command_t		info;	/* object information */
+  func_table_command_t		func;	/* function constructors/destructors */
+} load_union_t;
+
+/* Structure to point to load command and data section in memory.  */
+
+typedef struct load_all
+{
+  load_union_t *load;			/* load command */
+  char *section;			/* pointer to section */
+} load_all_t;
+
+/* Structure to contain information about a file mapped into memory.  */
+
+struct file_info
+{
+  char *start;				/* start of map */
+  char *name;				/* filename */
+  long	size;				/* size of the file */
+  long  rounded_size;			/* size rounded to page boundary */
+  int	fd;				/* file descriptor */
+  int	rw;				/* != 0 if opened read/write */
+  int	use_mmap;			/* != 0 if mmap'ed */
+};
+
+extern int decode_mach_o_hdr ();
+extern int encode_mach_o_hdr ();
+
+static void add_func_table	PROTO((mo_header_t *, load_all_t *,
+				       symbol_info_t *, int));
+static void print_header	PROTO((mo_header_t *));
+static void print_load_command	PROTO((load_union_t *, size_t, int));
+static void bad_header		PROTO((int));
+static struct file_info	*read_file  PROTO((char *, int, int));
+static void end_file		PROTO((struct file_info *));
+
+/* OSF/rose specific version to scan the name list of the loaded
+   program for the symbols g++ uses for static constructors and
+   destructors.
+
+   The constructor table begins at __CTOR_LIST__ and contains a count
+   of the number of pointers (or -1 if the constructors are built in a
+   separate section by the linker), followed by the pointers to the
+   constructor functions, terminated with a null pointer.  The
+   destructor table has the same format, and begins at __DTOR_LIST__.  */
+
+static void
+scan_prog_file (prog_name, which_pass)
+     char *prog_name;
+     enum pass which_pass;
+{
+  char *obj;
+  mo_header_t hdr;
+  load_all_t *load_array;
+  load_all_t *load_end;
+  load_all_t *load_cmd;
+  int symbol_load_cmds;
+  off_t offset;
+  int i;
+  int num_syms;
+  int status;
+  char *str_sect;
+  struct file_info *obj_file;
+  int prog_fd;
+  mo_lcid_t cmd_strings	  = -1;
+  symbol_info_t *main_sym = 0;
+  int rw		  = (which_pass != PASS_FIRST);
+
+  prog_fd = open (prog_name, (rw) ? O_RDWR : O_RDONLY);
+  if (prog_fd < 0)
+    fatal_perror ("open %s", prog_name);
+
+  obj_file = read_file (prog_name, prog_fd, rw);
+  obj = obj_file->start;
+
+  status = decode_mach_o_hdr (obj, MO_SIZEOF_RAW_HDR, MOH_HEADER_VERSION, &hdr);
+  if (status != MO_HDR_CONV_SUCCESS)
+    bad_header (status);
+
+
+  /* Do some basic sanity checks.  Note we explicitly use the big endian magic number,
+     since the hardware will automatically swap bytes for us on loading little endian
+     integers.  */
+
+#ifndef CROSS_COMPILE
+  if (hdr.moh_magic != MOH_MAGIC_MSB
+      || hdr.moh_header_version != MOH_HEADER_VERSION
+      || hdr.moh_byte_order != OUR_BYTE_ORDER
+      || hdr.moh_data_rep_id != OUR_DATA_REP_ID
+      || hdr.moh_cpu_type != OUR_CPU_TYPE
+      || hdr.moh_cpu_subtype != OUR_CPU_SUBTYPE
+      || hdr.moh_vendor_type != OUR_VENDOR_TYPE)
+    {
+      fatal ("incompatibilities between object file & expected values");
+    }
+#endif
+
+  if (debug)
+    print_header (&hdr);
+
+  offset = hdr.moh_first_cmd_off;
+  load_end = load_array
+    = (load_all_t *) xcalloc (sizeof (load_all_t), hdr.moh_n_load_cmds + 2);
+
+  /* Build array of load commands, calculating the offsets */
+  for (i = 0; i < hdr.moh_n_load_cmds; i++)
+    {
+      load_union_t *load_hdr;		/* load command header */
+
+      load_cmd = load_end++;
+      load_hdr = (load_union_t *) (obj + offset);
+
+      /* If modifying the program file, copy the header.  */
+      if (rw)
+	{
+	  load_union_t *ptr = (load_union_t *) xmalloc (load_hdr->hdr.ldci_cmd_size);
+	  bcopy ((char *)load_hdr, (char *)ptr, load_hdr->hdr.ldci_cmd_size);
+	  load_hdr = ptr;
+
+	  /* null out old command map, because we will rewrite at the end.  */
+	  if (ptr->hdr.ldci_cmd_type == LDC_CMD_MAP)
+	    {
+	      cmd_strings = ptr->map.lcm_ld_cmd_strings;
+	      ptr->hdr.ldci_cmd_type = LDC_UNDEFINED;
+	    }
+	}
+
+      load_cmd->load = load_hdr;
+      if (load_hdr->hdr.ldci_section_off > 0)
+	load_cmd->section = obj + load_hdr->hdr.ldci_section_off;
+
+      if (debug)
+	print_load_command (load_hdr, offset, i);
+
+      offset += load_hdr->hdr.ldci_cmd_size;
+    }
+
+  /* If the last command is the load command map and is not undefined,
+     decrement the count of load commands.  */
+  if (rw && load_end[-1].load->hdr.ldci_cmd_type == LDC_UNDEFINED)
+    {
+      load_end--;
+      hdr.moh_n_load_cmds--;
+    }
+
+  /* Go through and process each symbol table section.  */
+  symbol_load_cmds = 0;
+  for (load_cmd = load_array; load_cmd < load_end; load_cmd++)
+    {
+      load_union_t *load_hdr = load_cmd->load;
+
+      if (load_hdr->hdr.ldci_cmd_type == LDC_SYMBOLS)
+	{
+	  symbol_load_cmds++;
+
+	  if (debug)
+	    {
+	      char *kind = "unknown";
+
+	      switch (load_hdr->sym.symc_kind)
+		{
+		case SYMC_IMPORTS:	   kind = "imports"; break;
+		case SYMC_DEFINED_SYMBOLS: kind = "defined"; break;
+		case SYMC_STABS:	   kind = "stabs";   break;
+		}
+
+	      notice ("\nProcessing symbol table #%d, offset = 0x%.8lx, kind = %s\n",
+		      symbol_load_cmds, load_hdr->hdr.ldci_section_off, kind);
+	    }
+
+	  if (load_hdr->sym.symc_kind != SYMC_DEFINED_SYMBOLS)
+	    continue;
+
+	  str_sect = load_array[load_hdr->sym.symc_strings_section].section;
+	  if (str_sect == (char *) 0)
+	    fatal ("string section missing");
+
+	  if (load_cmd->section == (char *) 0)
+	    fatal ("section pointer missing");
+
+	  num_syms = load_hdr->sym.symc_nentries;
+	  for (i = 0; i < num_syms; i++)
+	    {
+	      symbol_info_t *sym = ((symbol_info_t *) load_cmd->section) + i;
+	      char *name = sym->si_name.symbol_name + str_sect;
+
+	      if (name[0] != '_')
+		continue;
+
+	      if (rw)
+		{
+		  char *n = name + strlen (name) - strlen (NAME__MAIN);
+
+		  if ((n - name) < 0 || strcmp (n, NAME__MAIN))
+		    continue;
+		  while (n != name)
+		    if (*--n != '_')
+		      continue;
+
+		  main_sym = sym;
+		}
+	      else
+		{
+		  switch (is_ctor_dtor (name))
+		    {
+		    case 1:
+		      add_to_list (&constructors, name);
+		      break;
+
+		    case 2:
+		      add_to_list (&destructors, name);
+		      break;
+
+		    default:	/* not a constructor or destructor */
+		      continue;
+		    }
+		}
+
+	      if (debug)
+		fprintf (stderr, "\ttype = 0x%.4x, sc = 0x%.2x, flags = 0x%.8x, name = %.30s\n",
+			 sym->si_type, sym->si_sc_type, sym->si_flags, name);
+	    }
+	}
+    }
+
+  if (symbol_load_cmds == 0)
+    fatal ("no symbol table found");
+
+  /* Update the program file now, rewrite header and load commands.  At present,
+     we assume that there is enough space after the last load command to insert
+     one more.  Since the first section written out is page aligned, and the
+     number of load commands is small, this is ok for the present.  */
+
+  if (rw)
+    {
+      load_union_t *load_map;
+      size_t size;
+
+      if (cmd_strings == -1)
+	fatal ("no cmd_strings found");
+
+      /* Add __main to initializer list.
+	 If we are building a program instead of a shared library, do not
+	 do anything, since in the current version, you cannot do mallocs
+	 and such in the constructors.  */
+
+      if (main_sym != (symbol_info_t *) 0
+	  && ((hdr.moh_flags & MOH_EXECABLE_F) == 0))
+	add_func_table (&hdr, load_array, main_sym, FNTC_INITIALIZATION);
+
+      if (debug)
+	notice ("\nUpdating header and load commands.\n\n");
+
+      hdr.moh_n_load_cmds++;
+      size = sizeof (load_cmd_map_command_t) + (sizeof (mo_offset_t) * (hdr.moh_n_load_cmds - 1));
+
+      /* Create new load command map.  */
+      if (debug)
+	notice ("load command map, %d cmds, new size %ld.\n",
+		(int) hdr.moh_n_load_cmds, (long) size);
+
+      load_map = (load_union_t *) xcalloc (1, size);
+      load_map->map.ldc_header.ldci_cmd_type = LDC_CMD_MAP;
+      load_map->map.ldc_header.ldci_cmd_size = size;
+      load_map->map.lcm_ld_cmd_strings = cmd_strings;
+      load_map->map.lcm_nentries = hdr.moh_n_load_cmds;
+      load_array[hdr.moh_n_load_cmds-1].load = load_map;
+
+      offset = hdr.moh_first_cmd_off;
+      for (i = 0; i < hdr.moh_n_load_cmds; i++)
+	{
+	  load_map->map.lcm_map[i] = offset;
+	  if (load_array[i].load->hdr.ldci_cmd_type == LDC_CMD_MAP)
+	    hdr.moh_load_map_cmd_off = offset;
+
+	  offset += load_array[i].load->hdr.ldci_cmd_size;
+	}
+
+      hdr.moh_sizeofcmds = offset - MO_SIZEOF_RAW_HDR;
+
+      if (debug)
+	print_header (&hdr);
+
+      /* Write header */
+      status = encode_mach_o_hdr (&hdr, obj, MO_SIZEOF_RAW_HDR);
+      if (status != MO_HDR_CONV_SUCCESS)
+	bad_header (status);
+
+      if (debug)
+	notice ("writing load commands.\n\n");
+
+      /* Write load commands */
+      offset = hdr.moh_first_cmd_off;
+      for (i = 0; i < hdr.moh_n_load_cmds; i++)
+	{
+	  load_union_t *load_hdr = load_array[i].load;
+	  size_t size = load_hdr->hdr.ldci_cmd_size;
+
+	  if (debug)
+	    print_load_command (load_hdr, offset, i);
+
+	  bcopy ((char *) load_hdr, (char *) (obj + offset), size);
+	  offset += size;
+	}
+    }
+
+  end_file (obj_file);
+
+  if (close (prog_fd))
+    fatal_perror ("close %s", prog_name);
+
+  if (debug)
+    fprintf (stderr, "\n");
+}
+
+
+/* Add a function table to the load commands to call a function
+   on initiation or termination of the process.  */
+
+static void
+add_func_table (hdr_p, load_array, sym, type)
+     mo_header_t *hdr_p;		/* pointer to global header */
+     load_all_t *load_array;		/* array of ptrs to load cmds */
+     symbol_info_t *sym;		/* pointer to symbol entry */
+     int type;				/* fntc_type value */
+{
+  /* Add a new load command.  */
+  int num_cmds = ++hdr_p->moh_n_load_cmds;
+  int load_index = num_cmds - 1;
+  size_t size = sizeof (func_table_command_t) + sizeof (mo_addr_t);
+  load_union_t *ptr = xcalloc (1, size);
+  load_all_t *load_cmd;
+  int i;
+
+  /* Set the unresolved address bit in the header to force the loader to be
+     used, since kernel exec does not call the initialization functions.  */
+  hdr_p->moh_flags |= MOH_UNRESOLVED_F;
+
+  load_cmd = &load_array[load_index];
+  load_cmd->load = ptr;
+  load_cmd->section = (char *) 0;
+
+  /* Fill in func table load command.  */
+  ptr->func.ldc_header.ldci_cmd_type = LDC_FUNC_TABLE;
+  ptr->func.ldc_header.ldci_cmd_size = size;
+  ptr->func.ldc_header.ldci_section_off = 0;
+  ptr->func.ldc_header.ldci_section_len = 0;
+  ptr->func.fntc_type = type;
+  ptr->func.fntc_nentries = 1;
+
+  /* copy address, turn it from abs. address to (region,offset) if necessary.  */
+  /* Is the symbol already expressed as (region, offset)?  */
+  if ((sym->si_flags & SI_ABSOLUTE_VALUE_F) == 0)
+    {
+      ptr->func.fntc_entry_loc[i].adr_lcid = sym->si_value.def_val.adr_lcid;
+      ptr->func.fntc_entry_loc[i].adr_sctoff = sym->si_value.def_val.adr_sctoff;
+    }
+
+  /* If not, figure out which region it's in.  */
+  else
+    {
+      mo_vm_addr_t addr = sym->si_value.abs_val;
+      int found = 0;
+
+      for (i = 0; i < load_index; i++)
+	{
+	  if (load_array[i].load->hdr.ldci_cmd_type == LDC_REGION)
+	    {
+	      region_command_t *region_ptr = &load_array[i].load->region;
+
+	      if ((region_ptr->regc_flags & REG_ABS_ADDR_F) != 0
+		  && addr >= region_ptr->regc_addr.vm_addr
+		  && addr <= region_ptr->regc_addr.vm_addr + region_ptr->regc_vm_size)
+		{
+		  ptr->func.fntc_entry_loc[0].adr_lcid = i;
+		  ptr->func.fntc_entry_loc[0].adr_sctoff = addr - region_ptr->regc_addr.vm_addr;
+		  found++;
+		  break;
+		}
+	    }
+	}
+
+      if (!found)
+	fatal ("could not convert 0x%l.8x into a region", addr);
+    }
+
+  if (debug)
+    notice ("%s function, region %d, offset = %ld (0x%.8lx)\n",
+	    type == FNTC_INITIALIZATION ? "init" : "term",
+	    (int) ptr->func.fntc_entry_loc[i].adr_lcid,
+	    (long) ptr->func.fntc_entry_loc[i].adr_sctoff,
+	    (long) ptr->func.fntc_entry_loc[i].adr_sctoff);
+
+}
+
+
+/* Print the global header for an OSF/rose object.  */
+
+static void
+print_header (hdr_ptr)
+     mo_header_t *hdr_ptr;
+{
+  fprintf (stderr, "\nglobal header:\n");
+  fprintf (stderr, "\tmoh_magic            = 0x%.8lx\n", hdr_ptr->moh_magic);
+  fprintf (stderr, "\tmoh_major_version    = %d\n", (int)hdr_ptr->moh_major_version);
+  fprintf (stderr, "\tmoh_minor_version    = %d\n", (int)hdr_ptr->moh_minor_version);
+  fprintf (stderr, "\tmoh_header_version   = %d\n", (int)hdr_ptr->moh_header_version);
+  fprintf (stderr, "\tmoh_max_page_size    = %d\n", (int)hdr_ptr->moh_max_page_size);
+  fprintf (stderr, "\tmoh_byte_order       = %d\n", (int)hdr_ptr->moh_byte_order);
+  fprintf (stderr, "\tmoh_data_rep_id      = %d\n", (int)hdr_ptr->moh_data_rep_id);
+  fprintf (stderr, "\tmoh_cpu_type         = %d\n", (int)hdr_ptr->moh_cpu_type);
+  fprintf (stderr, "\tmoh_cpu_subtype      = %d\n", (int)hdr_ptr->moh_cpu_subtype);
+  fprintf (stderr, "\tmoh_vendor_type      = %d\n", (int)hdr_ptr->moh_vendor_type);
+  fprintf (stderr, "\tmoh_load_map_cmd_off = %d\n", (int)hdr_ptr->moh_load_map_cmd_off);
+  fprintf (stderr, "\tmoh_first_cmd_off    = %d\n", (int)hdr_ptr->moh_first_cmd_off);
+  fprintf (stderr, "\tmoh_sizeofcmds       = %d\n", (int)hdr_ptr->moh_sizeofcmds);
+  fprintf (stderr, "\tmon_n_load_cmds      = %d\n", (int)hdr_ptr->moh_n_load_cmds);
+  fprintf (stderr, "\tmoh_flags            = 0x%.8lx", (long)hdr_ptr->moh_flags);
+
+  if (hdr_ptr->moh_flags & MOH_RELOCATABLE_F)
+    fprintf (stderr, ", relocatable");
+
+  if (hdr_ptr->moh_flags & MOH_LINKABLE_F)
+    fprintf (stderr, ", linkable");
+
+  if (hdr_ptr->moh_flags & MOH_EXECABLE_F)
+    fprintf (stderr, ", execable");
+
+  if (hdr_ptr->moh_flags & MOH_EXECUTABLE_F)
+    fprintf (stderr, ", executable");
+
+  if (hdr_ptr->moh_flags & MOH_UNRESOLVED_F)
+    fprintf (stderr, ", unresolved");
+
+  fprintf (stderr, "\n\n");
+  return;
+}
+
+
+/* Print a short summary of a load command.  */
+
+static void
+print_load_command (load_hdr, offset, number)
+     load_union_t *load_hdr;
+     size_t offset;
+     int number;
+{
+  mo_long_t type = load_hdr->hdr.ldci_cmd_type;
+  char *type_str = (char *) 0;
+
+  switch (type)
+    {
+    case LDC_UNDEFINED:   type_str = "UNDEFINED";	break;
+    case LDC_CMD_MAP:	  type_str = "CMD_MAP";		break;
+    case LDC_INTERPRETER: type_str = "INTERPRETER";	break;
+    case LDC_STRINGS:	  type_str = "STRINGS";		break;
+    case LDC_REGION:	  type_str = "REGION";		break;
+    case LDC_RELOC:	  type_str = "RELOC";		break;
+    case LDC_PACKAGE:	  type_str = "PACKAGE";		break;
+    case LDC_SYMBOLS:	  type_str = "SYMBOLS";		break;
+    case LDC_ENTRY:	  type_str = "ENTRY";		break;
+    case LDC_FUNC_TABLE:  type_str = "FUNC_TABLE";	break;
+    case LDC_GEN_INFO:	  type_str = "GEN_INFO";	break;
+    }
+
+  fprintf (stderr,
+	   "cmd %2d, sz: 0x%.2lx, coff: 0x%.3lx, doff: 0x%.6lx, dlen: 0x%.6lx",
+	   number,
+	   (long) load_hdr->hdr.ldci_cmd_size,
+	   (long) offset,
+	   (long) load_hdr->hdr.ldci_section_off,
+	   (long) load_hdr->hdr.ldci_section_len);
+
+  if (type_str == (char *) 0)
+    fprintf (stderr, ", ty: unknown (%ld)\n", (long) type);
+
+  else if (type != LDC_REGION)
+    fprintf (stderr, ", ty: %s\n", type_str);
+
+  else
+    {
+      char *region = "";
+      switch (load_hdr->region.regc_usage_type)
+	{
+	case REG_TEXT_T:	region = ", .text";	break;
+	case REG_DATA_T:	region = ", .data";	break;
+	case REG_BSS_T:		region = ", .bss";	break;
+	case REG_GLUE_T:	region = ", .glue";	break;
+#if defined (REG_RDATA_T) && defined (REG_SDATA_T) && defined (REG_SBSS_T) /*mips*/
+	case REG_RDATA_T:	region = ", .rdata";	break;
+	case REG_SDATA_T:	region = ", .sdata";	break;
+	case REG_SBSS_T:	region = ", .sbss";	break;
+#endif
+	}
+
+      fprintf (stderr, ", ty: %s, vaddr: 0x%.8lx, vlen: 0x%.6lx%s\n",
+	       type_str,
+	       (long) load_hdr->region.regc_vm_addr,
+	       (long) load_hdr->region.regc_vm_size,
+	       region);
+    }
+
+  return;
+}
+
+
+/* Fatal error when {en,de}code_mach_o_header fails.  */
+
+static void
+bad_header (status)
+     int status;
+{
+  switch (status)
+    {
+    case MO_ERROR_BAD_MAGIC:		fatal ("bad magic number");
+    case MO_ERROR_BAD_HDR_VERS:		fatal ("bad header version");
+    case MO_ERROR_BAD_RAW_HDR_VERS:	fatal ("bad raw header version");
+    case MO_ERROR_BUF2SML:		fatal ("raw header buffer too small");
+    case MO_ERROR_OLD_RAW_HDR_FILE:	fatal ("old raw header file");
+    case MO_ERROR_UNSUPPORTED_VERS:	fatal ("unsupported version");
+    default:
+      fatal ("unknown {de,en}code_mach_o_hdr return value %d", status);
+    }
+}
+
+
+/* Read a file into a memory buffer.  */
+
+static struct file_info *
+read_file (name, fd, rw)
+     char *name;		/* filename */
+     int fd;			/* file descriptor */
+     int rw;			/* read/write */
+{
+  struct stat stat_pkt;
+  struct file_info *p = (struct file_info *) xcalloc (sizeof (struct file_info), 1);
+#ifdef USE_MMAP
+  static int page_size;
+#endif
+
+  if (fstat (fd, &stat_pkt) < 0)
+    fatal_perror ("fstat %s", name);
+
+  p->name	  = name;
+  p->size	  = stat_pkt.st_size;
+  p->rounded_size = stat_pkt.st_size;
+  p->fd		  = fd;
+  p->rw		  = rw;
+
+#ifdef USE_MMAP
+  if (debug)
+    fprintf (stderr, "mmap %s, %s\n", name, (rw) ? "read/write" : "read-only");
+
+  if (page_size == 0)
+    page_size = sysconf (_SC_PAGE_SIZE);
+
+  p->rounded_size = ((p->size + page_size - 1) / page_size) * page_size;
+  p->start = mmap ((caddr_t) 0,
+		   (rw) ? p->rounded_size : p->size,
+		   (rw) ? (PROT_READ | PROT_WRITE) : PROT_READ,
+		   MAP_FILE | MAP_VARIABLE | MAP_SHARED,
+		   fd,
+		   0L);
+
+  if (p->start != (char *) 0 && p->start != (char *) -1)
+    p->use_mmap = 1;
+
+  else
+#endif /* USE_MMAP */
+    {
+      long len;
+
+      if (debug)
+	fprintf (stderr, "read %s\n", name);
+
+      p->use_mmap = 0;
+      p->start = xmalloc (p->size);
+      if (lseek (fd, 0L, SEEK_SET) < 0)
+	fatal_perror ("lseek %s 0", name);
+
+      len = read (fd, p->start, p->size);
+      if (len < 0)
+	fatal_perror ("read %s", name);
+
+      if (len != p->size)
+	fatal ("read %ld bytes, expected %ld, from %s", len, p->size, name);
+    }
+
+  return p;
+}
+
+/* Do anything necessary to write a file back from memory.  */
+
+static void
+end_file (ptr)
+     struct file_info *ptr;	/* file information block */
+{
+#ifdef USE_MMAP
+  if (ptr->use_mmap)
+    {
+      if (ptr->rw)
+	{
+	  if (debug)
+	    fprintf (stderr, "msync %s\n", ptr->name);
+
+	  if (msync (ptr->start, ptr->rounded_size, MS_ASYNC))
+	    fatal_perror ("msync %s", ptr->name);
+	}
+
+      if (debug)
+	fprintf (stderr, "munmap %s\n", ptr->name);
+
+      if (munmap (ptr->start, ptr->size))
+	fatal_perror ("munmap %s", ptr->name);
+    }
+  else
+#endif /* USE_MMAP */
+    {
+      if (ptr->rw)
+	{
+	  long len;
+
+	  if (debug)
+	    fprintf (stderr, "write %s\n", ptr->name);
+
+	  if (lseek (ptr->fd, 0L, SEEK_SET) < 0)
+	    fatal_perror ("lseek %s 0", ptr->name);
+
+	  len = write (ptr->fd, ptr->start, ptr->size);
+	  if (len < 0)
+	    fatal_perror ("write %s", ptr->name);
+
+	  if (len != ptr->size)
+	    fatal ("wrote %ld bytes, expected %ld, to %s", len, ptr->size, ptr->name);
+	}
+
+      free (ptr->start);
+    }
+
+  free (ptr);
+}
+
+#endif /* OBJECT_FORMAT_ROSE */
+
+void empty_undef_list(void)
+{
+	struct undef_list_node *cur;
+	struct undef_list_node *next;
+
+	cur = undef_list.next; 
+
+	while (cur)
+	{
+		next = cur->next;
+
+		if (cur->name)
+			free(cur->name);
+		
+		free(cur);
+
+		cur = next;
+	}
+}
+
+struct undef_list_node *find_undef_list(char *name)
+{
+	struct undef_list_node *cur;
+
+	for (cur = undef_list.next; cur; cur = cur->next)
+	{
+		if (strcmp(cur->name, name) == 0)
+			return cur;
+	}
+
+	return 0;
+}
+
+
+void add_undef_list(char *name)
+{
+	struct undef_list_node *newnode;
+	struct undef_list_node *prev;
+	struct undef_list_node *cur;
+
+	newnode = xmalloc(sizeof (struct undef_list_node));
+	newnode->name = strdup(name);
+	newnode->reported = 0;
+	
+	prev = &undef_list;
+	cur = undef_list.next;
+
+	do
+	{
+		int res;
+
+		if (cur)
+			res = strcmp(cur->name, newnode->name);
+		else
+		{
+			prev->next = newnode;
+			newnode->next = cur;
+			return;
+		}
+
+
+		if (res == 0)
+		{
+			free(newnode->name);
+			free(newnode);
+			return;
+		}
+
+		if (res > 0)
+		{
+			prev->next = newnode;
+			newnode->next = cur;
+			return;
+		}
+
+		prev = cur;
+		cur = cur->next;
+	} while (cur);
+
+	prev->next = newnode;
+	newnode->next = cur;
+}
+
+void report_undef_list(char **object_lst)
+{
+	struct undef_list_node *cur;
+	int pipe_fd[2];
+	int numargs;
+	char **nm_argv;
+	int argc;
+	void (*int_handler) ();
+	void (*quit_handler) ();
+	char buf[2048];
+	FILE *inf;
+	int pid;
+	int print_head = 1;
+	char *scmd,*s;
+	int i,j,len,arglen,c,need_quote;
+
+	cur = undef_list.next; 
+	if (!cur)
+		return;
+
+	/* Count number of object files */
+	for (numargs = 0; object_lst[numargs]; numargs++)
+	{
+		if (debug)
+			fprintf (stderr, "Object file %s\n", object_lst[numargs]);
+	}
+
+	fflush(stderr);
+
+	/* Build arguments for nm */
+	if (nm_file_name == 0)
+		fatal ("cannot find `nm'");
+
+	nm_argv = xmalloc(sizeof(char *)*(numargs+5));
+	
+	argc = 0;
+
+	nm_argv[argc++] = nm_file_name;
+	nm_argv[argc++] = "-A";
+	nm_argv[argc++] = "-u";
+
+	for (i = 0; i < numargs; i++)
+		nm_argv[argc++] = object_lst[i];
+	
+	nm_argv[argc++] = 0;
+
+  len = 0;
+
+  for(i = 0 ; nm_argv[i] != NULL ; i++)
+  {
+    arglen = strlen(nm_argv[i]);
+
+    len += 1 + arglen;
+
+    for(j = 0, need_quote = 0 ; j < arglen ; j++)
+    {
+      c = nm_argv[i][j];
+
+      if(c == ' ')
+        need_quote = 1;
+      else if (c == '\"')
+        len++;
+    }
+
+    if(need_quote)
+      len += 2;
+  }
+
+  s = scmd = (char *) xmalloc (len+1);
+
+  for(i = 0 ; nm_argv[i] != NULL ; i++)
+  {
+    arglen = strlen(nm_argv[i]);
+
+    for(j = 0, need_quote = 0 ; j < arglen ; j++)
+    {
+      if(nm_argv[i][j] == ' ')
+        need_quote = 1;
+    }
+
+    if(s != scmd)
+      (*s++) = ' ';
+
+    if(need_quote)
+      (*s++) = '\"';
+
+    for(j = 0 ; j < arglen ; j++)
+    {
+      c = nm_argv[i][j];
+      if(c == '\"')
+        (*s++) = '*';
+
+      (*s++) = c;
+    }
+
+    if(need_quote)
+      (*s++) = '\"';
+  }
+
+  (*s) = '\0';
+
+  /* Trace if needed.  */
+  if (vflag)
+    {
+      char **p_argv;
+      char *str;
+
+      for (p_argv = &nm_argv[0]; (str = *p_argv) != (char *) 0; p_argv++)
+	fprintf (stderr, " %s", str);
+
+      fprintf (stderr, "\n");
+    }
+
+  fflush (stdout);
+  fflush (stderr);
+
+  inf = popen(scmd,"r");
+  if (inf == (FILE *) NULL)
+    fatal_perror ("popen");
+
+  free(scmd);
+#if 0
+	while (fgets (buf, sizeof buf, inf) != (char *) 0)
+	{
+		char *filename;
+		char *symname;
+		char *end;
+		struct undef_list_node *node;
+
+		/* Scan the nm output */
+		filename = buf;
+		symname = strchr(buf, ':');
+
+		/* Check for malformed line (shouldn't happen) */
+		if (!symname)
+			continue;
+
+		/* Seperate filename */
+		*symname++ = 0;
+
+		/* Kill off \n at end of line */
+		end = strchr(symname, '\n');
+		if (end)
+			*end = 0;
+
+		/* Find the node */
+		node = find_undef_list(symname);
+		
+		if (node)
+		{
+			fprintf(stderr, "%s: Undefined reference to %s\n", filename, symname);
+			node->reported++;
+		}
+		
+
+	}
+
+#endif
+	if (fclose (inf) != 0)
+		fatal_perror ("fclose");
+	
+	do_wait (nm_file_name);
+	
+	signal (SIGINT,  int_handler);
+#ifdef SIGQUIT
+	signal (SIGQUIT, quit_handler);
+#endif 
+ 
+	/* Show remaining (if any) */
+	cur = undef_list.next; 
+
+	while (cur)
+	{
+		if (!cur->reported)
+		{
+			if (print_head)
+			{
+				print_head = 0;
+				fprintf(stderr, "Other undefined references:\n");
+			}
+			fprintf(stderr, "Undefined reference to `%s'\n", cur->name);
+		}
+
+		cur = cur->next;
+	}
+
+	collect_exit (FATAL_EXIT_CODE);
+}
diff -urNEBb gcc-2.95.3-orig/gcc/c-typeck.c gcc-2.95.3/gcc/c-typeck.c
--- gcc-2.95.3-orig/gcc/c-typeck.c	2001-01-25 15:03:00.000000000 +0100
+++ gcc-2.95.3/gcc/c-typeck.c	2003-12-02 17:50:55.000000000 +0100
@@ -1569,6 +1569,14 @@
   /* fntype now gets the type of function pointed to.  */
   fntype = TREE_TYPE (fntype);
 
+  if (lookup_attribute("libcall", TYPE_ATTRIBUTES(fntype))) 
+   if (TREE_CODE(function)==COMPONENT_REF)
+    params = chainon (build_tree_list(NULL_TREE, 
+                                      build1(ADDR_EXPR,build_pointer_type(TREE_TYPE(TREE_OPERAND(function,0))),
+				             TREE_OPERAND(function,0))
+				      )
+		      , params);
+
   /* Convert the parameters to the types declared in the
      function prototype, or apply default promotions.  */
 
diff -urNEBb gcc-2.95.3-orig/gcc/cccp.c gcc-2.95.3/gcc/cccp.c
--- gcc-2.95.3-orig/gcc/cccp.c	2001-01-25 15:03:00.000000000 +0100
+++ gcc-2.95.3/gcc/cccp.c	2003-12-02 17:50:55.000000000 +0100
@@ -85,7 +85,7 @@
 
 /* Windows does not natively support inodes, and neither does MSDOS.  */
 #if (defined (_WIN32) && ! defined (__CYGWIN__) && ! defined (_UWIN)) \
-  || defined (__MSDOS__)
+  || defined (__MSDOS__) || defined (__amigaos__)
 #define INO_T_EQ(a, b) 0
 #endif
 
@@ -101,8 +101,15 @@
 #define INCLUDE_LEN_FUDGE 0
 #endif
 
+#undef OPEN_CASE_SENSITIVE
+
 /* External declarations.  */
 
+#ifndef OPEN_CASE_SENSITIVE
+/* Default is standard open() */
+#define OPEN_CASE_SENSITIVE open
+#endif
+
 extern char *version_string;
 HOST_WIDEST_INT parse_escape PROTO((char **, HOST_WIDEST_INT));
 HOST_WIDEST_INT parse_c_expression PROTO((char *, int));
@@ -1918,7 +1925,12 @@
 	notice ("#include <...> search starts here:\n");
       if (!p->fname[0])
 	fprintf (stderr, " .\n");
-      else if (!strcmp (p->fname, "/") || !strcmp (p->fname, "//"))
+      else if (!strcmp (p->fname, "/") || !strcmp (p->fname, "//")
+#ifdef VOL_SEPARATOR
+	/* Don't omit the last character if it's not a '/'.  */
+	       || p->fname[strlen (p->fname) - 1] != '/'
+#endif
+	       )
 	fprintf (stderr, " %s\n", p->fname);
       else
 	/* Omit trailing '/'.  */
@@ -4785,6 +4797,9 @@
 #ifdef DIR_SEPARATOR
   if ((p = rindex (s, DIR_SEPARATOR))) s = p + 1;
 #endif
+#ifdef VOL_SEPARATOR
+  if ((p = rindex (s, VOL_SEPARATOR))) s = p + 1;
+#endif
   return s;
 }
 
@@ -4794,6 +4809,7 @@
 absolute_filename (filename)
      char *filename;
 {
+#ifndef FILE_NAME_ABSOLUTE_P
 #if defined (__MSDOS__) \
   || (defined (_WIN32) && !defined (__CYGWIN__) && !defined (_UWIN))
   if (ISALPHA (filename[0]) && filename[1] == ':') filename += 2;
@@ -4810,6 +4826,9 @@
   if (filename[0] == DIR_SEPARATOR) return 1;
 #endif
   return 0;
+#else /* FILE_NAME_ABSOLUTE_P */
+  return FILE_NAME_ABSOLUTE_P (filename);
+#endif /* FILE_NAME_ABSOLUTE_P */
 }
 
 /* Returns whether or not a given character is a directory separator.
@@ -5072,7 +5091,7 @@
       || ! inc->control_macro
       || (inc->control_macro[0] && ! lookup (inc->control_macro, -1, -1))) {
 
-    fd = open (fname, O_RDONLY, 0);
+    fd = OPEN_CASE_SENSITIVE (fname, O_RDONLY, 0);
 
     if (fd < 0)
       {
@@ -10406,7 +10425,12 @@
     len = simplify_filename (dir->fname);
 
     /* Convert directory name to a prefix.  */
-    if (len && dir->fname[len - 1] != DIR_SEPARATOR) {
+    if (len && dir->fname[len - 1] != DIR_SEPARATOR
+#ifdef VOL_SEPARATOR
+	&& dir->fname[len - 1] != VOL_SEPARATOR
+#endif
+	)
+    {
       if (len == 1 && dir->fname[len - 1] == '.')
 	len = 0;
       else
diff -urNEBb gcc-2.95.3-orig/gcc/collect2.c gcc-2.95.3/gcc/collect2.c
--- gcc-2.95.3-orig/gcc/collect2.c	2001-01-25 15:03:01.000000000 +0100
+++ gcc-2.95.3/gcc/collect2.c	2003-12-06 19:26:25.000000000 +0100
@@ -30,6 +30,11 @@
 #include "system.h"
 #include <signal.h>
 
+#ifdef __amigaos4__
+#define NSIG 6
+#define NO_SYS_SIGLIST
+#endif
+
 #ifdef vfork /* Autoconf may define this to fork for us. */
 # define VFORK_STRING "fork"
 #else
@@ -1094,6 +1099,9 @@
 #endif
 
   /* Extract COMPILER_PATH and PATH into our prefix list.  */
+#ifdef __amigaos4__
+  prefix_from_string ("/gcc/bin", &cpath);
+#endif    
   prefix_from_env ("COMPILER_PATH", &cpath);
   prefix_from_env ("PATH", &path);
 
@@ -2238,6 +2246,8 @@
    constructor functions, terminated with a null pointer.  The
    destructor table has the same format, and begins at __DTOR_LIST__.  */
 
+#ifndef __amigaos4__
+
 static void
 scan_prog_file (prog_name, which_pass)
      char *prog_name;
@@ -2400,7 +2410,199 @@
   signal (SIGQUIT, quit_handler);
 #endif
 }
+#else
+
+
+static void
+scan_prog_file (prog_name, which_pass)
+     char *prog_name;
+     enum pass which_pass;
+{
+  void (*int_handler) ();
+  void (*quit_handler) ();
+  char *nm_argv[4];
+  int pid;
+  int argc = 0;
+  int pipe_fd[2];
+  char *p, buf[1024];
+  FILE *inf;
+  char *scmd,*s;
+  int i, j,len,arglen,c,need_quote;
+
+  if (which_pass == PASS_SECOND)
+    return;
+
+  /* If we do not have an `nm', complain.  */
+  if (nm_file_name == 0)
+    fatal ("cannot find `nm'");
+
+  nm_argv[argc++] = nm_file_name;
+  if (NM_FLAGS[0] != '\0')
+    nm_argv[argc++] = NM_FLAGS;
+
+  nm_argv[argc++] = prog_name;
+  nm_argv[argc++] = (char *) 0;
+
+
+  len = 0;
+
+  for(i = 0 ; nm_argv[i] != NULL ; i++)
+  {
+    arglen = strlen(nm_argv[i]);
+
+    len += 1 + arglen;
+
+    for(j = 0, need_quote = 0 ; j < arglen ; j++)
+    {
+      c = nm_argv[i][j];
+
+      if(c == ' ')
+        need_quote = 1;
+      else if (c == '\"')
+        len++;
+    }
+
+    if(need_quote)
+      len += 2;
+  }
+
+  s = scmd = (char *) xmalloc (len+1);
+
+  for(i = 0 ; nm_argv[i] != NULL ; i++)
+  {
+    arglen = strlen(nm_argv[i]);
+
+    for(j = 0, need_quote = 0 ; j < arglen ; j++)
+    {
+      if(nm_argv[i][j] == ' ')
+        need_quote = 1;
+    }
+
+    if(s != scmd)
+      (*s++) = ' ';
+
+    if(need_quote)
+      (*s++) = '\"';
+
+    for(j = 0 ; j < arglen ; j++)
+    {
+      c = nm_argv[i][j];
+      if(c == '\"')
+        (*s++) = '*';
+
+      (*s++) = c;
+    }
+
+    if(need_quote)
+      (*s++) = '\"';
+  }
+
+  (*s) = '\0';
+
+  /* Trace if needed.  */
+  if (vflag)
+    {
+      char **p_argv;
+      char *str;
+
+      for (p_argv = &nm_argv[0]; (str = *p_argv) != (char *) 0; p_argv++)
+	fprintf (stderr, " %s", str);
+
+      fprintf (stderr, "\n");
+    }
+
+  fflush (stdout);
+  fflush (stderr);
+
+  inf = popen(scmd,"r");
+  if (inf == (FILE *) NULL)
+    fatal_perror ("popen");
+
+  free(scmd);
+
+  if (debug)
+    fprintf (stderr, "\nnm output with constructors/destructors.\n");
+
+  /* Read each line of nm output.  */
+  while (fgets (buf, sizeof buf, inf) != (char *) 0)
+    {
+      int ch, ch2;
+      char *name, *end;
+	  
+      /* If it contains a constructor or destructor name, add the name
+	 to the appropriate list.  */
+
+      for (p = buf; (ch = *p) != '\0' && ch != '\n' && ch != '_'; p++)
+	if (ch == ' ' && p[1] == 'U' && p[2] == ' ')
+	  break;
+
+      if (ch != '_')
+	continue;
+  
+      name = p;
+      /* Find the end of the symbol name.
+	 Do not include `|', because Encore nm can tack that on the end.  */
+      for (end = p; (ch2 = *end) != '\0' && !ISSPACE (ch2) && ch2 != '|';
+	   end++)
+	continue;
+
+
+      *end = '\0';
+
+      switch (is_ctor_dtor (name))
+	{
+	case 1:
+	  if (which_pass != PASS_LIB)
+	    add_to_list (&constructors, name);
+	  break;
+
+	case 2:
+	  if (which_pass != PASS_LIB)
+	    add_to_list (&destructors, name);
+	  break;
+
+	case 3:
+	  if (which_pass != PASS_LIB)
+	    fatal ("init function found in object %s", prog_name);
+#ifndef LD_INIT_SWITCH
+	  add_to_list (&constructors, name);
+#endif
+	  break;
+
+	case 4:
+	  if (which_pass != PASS_LIB)
+	    fatal ("fini function found in object %s", prog_name);
+#ifndef LD_FINI_SWITCH
+	  add_to_list (&destructors, name);
+#endif
+	  break;
+
+	case 5:
+	  if (which_pass != PASS_LIB)
+	    add_to_list (&frame_tables, name);
+	  break;
+
+	default:		/* not a constructor or destructor */
+	  continue;
+	}
+
+      if (debug)
+	fprintf (stderr, "\t%s\n", buf);
+    }
+
+  if (debug)
+    fprintf (stderr, "\n");
+
+  if (fclose (inf) != 0)
+    fatal_perror ("fclose");
+
+  signal (SIGINT,  int_handler);
+#ifdef SIGQUIT
+  signal (SIGQUIT, quit_handler);
+#endif
+}
 
+#endif
 #if SUNOS4_SHARED_LIBRARIES
 
 /* Routines to scan the SunOS 4 _DYNAMIC structure to find shared libraries
@@ -2571,9 +2773,14 @@
 	      }
 	}
       /* built in directories are /lib, /usr/lib, and /usr/local/lib */
+#ifdef __amigaos4__
+      *pp++ = "/gcc/lib";
+      *pp++ = "/gcc/local/lib";
+#else
       *pp++ = "/lib";
       *pp++ = "/usr/lib";
       *pp++ = "/usr/local/lib";
+#endif      
       *pp = 0;
     }
   libname = name;
diff -urNEBb gcc-2.95.3-orig/gcc/config/arm/coff.h gcc-2.95.3/gcc/config/arm/coff.h
--- gcc-2.95.3-orig/gcc/config/arm/coff.h	1999-03-22 17:32:25.000000000 +0100
+++ gcc-2.95.3/gcc/config/arm/coff.h	2003-12-02 17:50:55.000000000 +0100
@@ -41,9 +41,10 @@
    command line option -mstructure_size_boundary=<n> can be used to change this
    value.  */
 #undef  STRUCTURE_SIZE_BOUNDARY
-#define STRUCTURE_SIZE_BOUNDARY arm_structure_size_boundary
+/*#define STRUCTURE_SIZE_BOUNDARY arm_structure_size_boundary*/
+#define STRUCTURE_SIZE_BOUNDARY 32
 
-extern int arm_structure_size_boundary;
+/*extern int arm_structure_size_boundary;*/
 
 /* A C expression whose value is nonzero if IDENTIFIER with arguments ARGS
    is a valid machine specific attribute for DECL.
diff -urNEBb gcc-2.95.3-orig/gcc/config/arm/elf.h gcc-2.95.3/gcc/config/arm/elf.h
--- gcc-2.95.3-orig/gcc/config/arm/elf.h	1999-05-31 10:21:53.000000000 +0200
+++ gcc-2.95.3/gcc/config/arm/elf.h	2003-12-02 17:50:55.000000000 +0100
@@ -172,9 +172,10 @@
    command line option -mstructure_size_boundary=<n> can be used to change this
    value.  */
 #undef  STRUCTURE_SIZE_BOUNDARY
-#define STRUCTURE_SIZE_BOUNDARY arm_structure_size_boundary
+/*#define STRUCTURE_SIZE_BOUNDARY arm_structure_size_boundary*/
+#define STRUCTURE_SIZE_BOUNDARY 32
 
-extern int arm_structure_size_boundary;
+/*extern int arm_structure_size_boundary;*/
 
 /* A C expression whose value is nonzero if IDENTIFIER with arguments ARGS
    is a valid machine specific attribute for DECL.
diff -urNEBb gcc-2.95.3-orig/gcc/config/arm/tcoff.h gcc-2.95.3/gcc/config/arm/tcoff.h
--- gcc-2.95.3-orig/gcc/config/arm/tcoff.h	1998-12-16 22:01:58.000000000 +0100
+++ gcc-2.95.3/gcc/config/arm/tcoff.h	2003-12-02 17:50:55.000000000 +0100
@@ -33,9 +33,10 @@
    command line option -mstructure_size_boundary=<n> can be used to change this
    value.  */
 #undef STRUCTURE_SIZE_BOUNDARY
-#define STRUCTURE_SIZE_BOUNDARY arm_structure_size_boundary
+/*#define STRUCTURE_SIZE_BOUNDARY arm_structure_size_boundary*/
+#define STRUCTURE_SIZE_BOUNDARY 32
 
-extern int arm_structure_size_boundary;
+/*extern int arm_structure_size_boundary;*/
 
 /* This is COFF, but prefer stabs.  */
 #define SDB_DEBUGGING_INFO
diff -urNEBb gcc-2.95.3-orig/gcc/config/m68k/amigaos.c gcc-2.95.3/gcc/config/m68k/amigaos.c
--- gcc-2.95.3-orig/gcc/config/m68k/amigaos.c	1970-01-01 01:00:00.000000000 +0100
+++ gcc-2.95.3/gcc/config/m68k/amigaos.c	2003-12-02 17:50:55.000000000 +0100
@@ -0,0 +1,419 @@
+/* Configuration for GNU C-compiler for m68k Amiga, running AmigaOS.
+   Copyright (C) 1992, 93-96, 1997 Free Software Foundation, Inc.
+   Contributed by Markus M. Wild (wild@amiga.physik.unizh.ch).
+   Heavily modified by Kamil Iskra (iskra@student.uci.agh.edu.pl).
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING.  If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#include "config.h"
+#include "system.h"
+#include "rtl.h"
+#include "output.h"
+#include "tree.h"
+#include "flags.h"
+#include "expr.h"
+
+/* Baserel support.  */
+
+/* Does operand (which is a symbolic_operand) live in text space? If
+   so SYMBOL_REF_FLAG, which is set by ENCODE_SECTION_INFO, will be true.
+
+   This function is used in base relative code generation. */
+
+int
+read_only_operand (operand)
+     rtx operand;
+{
+  if (GET_CODE (operand) == CONST)
+    operand = XEXP (XEXP (operand, 0), 0);
+  if (GET_CODE (operand) == SYMBOL_REF)
+    return SYMBOL_REF_FLAG (operand) || CONSTANT_POOL_ADDRESS_P (operand);
+  return 1;
+}
+
+/* This function is used while generating a base relative code.
+   It returns 1 if a decl is not relocatable, i. e., if it can be put
+   in the text section.
+   Currently, it's very primitive: it just checks if the object size
+   is less than 4 bytes (i. e., if it can hold a pointer).  It also
+   supports arrays and floating point types.  */
+
+int
+amigaos_put_in_text (decl)
+     tree decl;
+{
+  tree type = TREE_TYPE (decl);
+  if (TREE_CODE (type) == ARRAY_TYPE)
+    type = TREE_TYPE (type);
+  return (TREE_INT_CST_HIGH (TYPE_SIZE (type)) == 0
+	  && TREE_INT_CST_LOW (TYPE_SIZE (type)) < 32)
+	 || FLOAT_TYPE_P (type);
+}
+
+/* Common routine used to check if a4 should be preserved/restored.  */
+
+int
+amigaos_restore_a4 ()
+{
+  return (flag_pic >= 3 &&
+	  (TARGET_RESTORE_A4 || TARGET_ALWAYS_RESTORE_A4
+	   || lookup_attribute ("saveds",
+				TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl)))));
+}
+
+void
+amigaos_alternate_pic_setup (stream)
+     FILE *stream;
+{
+  if (TARGET_RESTORE_A4 || TARGET_ALWAYS_RESTORE_A4)
+    asm_fprintf (stream, "\tjbsr %U__restore_a4\n");
+  else if (lookup_attribute ("saveds",
+			     TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl))))
+    asm_fprintf (stream, "\tlea %U__a4_init,%Ra4\n");
+}
+
+/* Attributes support.  */
+
+#define AMIGA_CHIP_SECTION_NAME ".datachip"
+
+/* Return nonzero if IDENTIFIER with arguments ARGS is a valid machine
+   specific attribute for DECL.  The attributes in ATTRIBUTES have previously
+   been assigned to DECL. */
+
+int
+valid_amigaos_decl_attribute (decl, identifier)
+     tree decl, identifier;
+{
+  if (TREE_CODE (decl) == VAR_DECL)
+    if (is_attribute_p ("chip", identifier))
+#ifdef ASM_OUTPUT_SECTION_NAME
+      {
+	if (! TREE_STATIC (decl) && ! DECL_EXTERNAL (decl))
+	  error ("`chip' attribute cannot be specified for local variables");
+	else
+	  {
+	    /* The decl may have already been given a section attribute from
+	       a previous declaration.  Ensure they match.  */
+	    if (DECL_SECTION_NAME (decl) == NULL_TREE)
+	      DECL_SECTION_NAME (decl) =
+		build_string (strlen (AMIGA_CHIP_SECTION_NAME) + 1,
+			      AMIGA_CHIP_SECTION_NAME);
+	    else if (strcmp (TREE_STRING_POINTER (DECL_SECTION_NAME (decl)),
+			     AMIGA_CHIP_SECTION_NAME) != 0)
+	      {
+		error_with_decl (decl,
+			"`chip' for `%s' conflicts with previous declaration");
+		return 0;
+	      }
+	    return 1;
+	  }
+      }
+#else
+      error ("`chip' attribute is not supported for this target");
+#endif
+
+  return 0;
+}
+
+/* Return nonzero if IDENTIFIER with arguments ARGS is a valid machine
+   specific attribute for TYPE.  The attributes in ATTRIBUTES have previously
+   been assigned to TYPE.  */
+
+int
+valid_amigaos_type_attribute (type, attributes, identifier, args)
+     tree type, attributes, identifier, args;
+{
+  if (valid_m68k_type_attribute (type, attributes, identifier, args))
+    return 1;
+  else if (TREE_CODE (type) == FUNCTION_TYPE || TREE_CODE (type) == METHOD_TYPE)
+    {
+      if (is_attribute_p ("stackext", identifier))
+	{
+	  if (lookup_attribute ("interrupt", attributes))
+	    {
+	      error ("`stackext' and `interrupt' are mutually exclusive");
+	      return 0;
+	    }
+	  return 1;
+	}
+      if (is_attribute_p ("interrupt", identifier))
+	{
+	  if (lookup_attribute ("stackext", attributes))
+	    {
+	      error ("`stackext' and `interrupt' are mutually exclusive");
+	      return 0;
+	    }
+	  return 1;
+	}
+      if (is_attribute_p ("saveds", identifier))
+	return 1;
+    }
+
+  return 0;
+}
+
+/* Stack checking and automatic extension support.  */
+
+void
+amigaos_prologue_begin_hook (stream, fsize)
+     FILE *stream;
+     int fsize;
+{
+  if (TARGET_STACKCHECK)
+    {
+      if (fsize < 256)
+	asm_fprintf (stream, "\tcmpl %s,%Rsp\n"
+			     "\tjcc 0f\n"
+			     "\tjra %U__stkovf\n"
+			     "\t0:\n",
+		     (flag_pic == 3 ? "a4@(___stk_limit:W)" :
+				      (flag_pic == 4 ? "a4@(___stk_limit:L)" :
+						       "___stk_limit")));
+      else if (fsize < 0x8000)
+	asm_fprintf (stream, "\tmovel #%d:W,%Rd0\n\tjbsr %U__stkchk_d0\n",
+		     fsize);
+      else
+	asm_fprintf (stream, "\tmovel #%d,%Rd0\n\tjbsr %U__stkchk_d0\n",
+		     fsize);
+    }
+}
+
+void
+amigaos_alternate_frame_setup_f (stream, fsize)
+     FILE *stream;
+     int fsize;
+{
+  if (fsize < 128)
+    asm_fprintf (stream, "\tcmpl %s,%Rsp\n"
+			 "\tjcc 0f\n"
+			 "\tmoveq #%d,%Rd0\n"
+			 "\tmoveq #0,%Rd1\n"
+			 "\tjbsr %U__stkext_f\n"
+			 "0:\tlink %Ra5,#%d:W\n",
+		 (flag_pic == 3 ? "a4@(___stk_limit:W)" :
+				  (flag_pic == 4 ? "a4@(___stk_limit:L)" :
+						   "___stk_limit")),
+		 fsize, -fsize);
+  else if (fsize < 0x8000)
+    asm_fprintf (stream, "\tmovel #%d:W,%Rd0\n\tjbsr %U__link_a5_d0_f\n",
+		 fsize);
+  else
+    asm_fprintf (stream, "\tmovel #%d,%Rd0\n\tjbsr %U__link_a5_d0_f\n",
+		 fsize);
+}
+
+void
+amigaos_alternate_frame_setup (stream, fsize)
+     FILE *stream;
+     int fsize;
+{
+  if (! fsize)
+    asm_fprintf (stream, "\tcmpl %s,%Rsp\n"
+			 "\tjcc 0f\n"
+			 "\tmoveq #0,%Rd0\n"
+			 "\tmoveq #0,%Rd1\n"
+			 "\tjbsr %U__stkext_f\n"
+			 "0:\n",
+		 (flag_pic == 3 ? "a4@(___stk_limit:W)" :
+				  (flag_pic == 4 ? "a4@(___stk_limit:L)" :
+						   "___stk_limit")));
+  else if (fsize + 4 < 128)
+    asm_fprintf (stream, "\tcmpl %s,%Rsp\n"
+			 "\tjcc 0f\n"
+			 "\tmoveq #%d,%Rd0\n"
+			 "\tmoveq #0,%Rd1\n"
+			 "\tjbsr %U__stkext_f\n"
+			 "0:\taddw #%d,%Rsp\n",
+		 (flag_pic == 3 ? "a4@(___stk_limit:W)" :
+				  (flag_pic == 4 ? "a4@(___stk_limit:L)" :
+						   "___stk_limit")),
+		 fsize + 4, -(fsize + 4));
+  else if (fsize + 4 < 0x8000)
+    asm_fprintf (stream, "\tmovel #%d:W,%Rd0\n\tjbsr %U__sub_d0_sp_f\n",
+		 fsize + 4);
+  else
+    asm_fprintf (stream, "\tmovel %0I%d,%Rd0\n\tjbsr %U__sub_d0_sp_f\n",
+		 fsize + 4);
+}
+
+static rtx
+gen_stack_management_call (stack_pointer, arg, func)
+     rtx stack_pointer;
+     rtx arg;
+     char *func;
+{
+  rtx call_insn, call, seq, name;
+  start_sequence ();
+
+  /* Move arg to d0.  */
+  emit_move_insn (gen_rtx (REG, SImode, 0), arg);
+
+  /* Generate the function reference.  */
+  name = gen_rtx (SYMBOL_REF, Pmode, func);
+  SYMBOL_REF_FLAG (name) = 1;
+  /* If optimizing, put it in a psedo so that several loads can be merged
+     into one.  */
+  if (optimize && ! flag_no_function_cse)
+    name = copy_to_reg (name);
+
+  /* Generate the function call.  */
+  call = gen_rtx (CALL, VOIDmode, gen_rtx (MEM, FUNCTION_MODE, name),
+		  const0_rtx);
+  /* If we are doing stack extension, notify about the sp change.  */
+  if (stack_pointer)
+    call = gen_rtx (SET, VOIDmode, stack_pointer, call);
+
+  /* Generate the call instruction.  */
+  call_insn = emit_call_insn (call);
+  /* Stack extension does not change memory in an unpredictable way.  */
+  CONST_CALL_P (call_insn) = 1;
+  /* We pass an argument in d0.  */
+  CALL_INSN_FUNCTION_USAGE (call_insn) = gen_rtx (EXPR_LIST, VOIDmode,
+	gen_rtx (USE, VOIDmode, gen_rtx (REG, SImode, 0)), 0);
+
+  seq = gen_sequence ();
+  end_sequence ();
+  return seq;
+}
+
+rtx
+gen_stack_cleanup_call (stack_pointer, sa)
+     rtx stack_pointer;
+     rtx sa;
+{
+  return gen_stack_management_call (stack_pointer, sa, "__move_d0_sp");
+}
+
+void
+amigaos_alternate_allocate_stack (operands)
+     rtx *operands;
+{
+  if (TARGET_STACKEXTEND)
+    emit_insn ((rtx)gen_stack_management_call (stack_pointer_rtx, operands[1],
+					       "__sub_d0_sp"));
+  else
+    {
+      if (TARGET_STACKCHECK)
+	emit_insn ((rtx)gen_stack_management_call (0, operands[1],
+						   "__stkchk_d0"));
+      anti_adjust_stack (operands[1]);
+    }
+  emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
+}
+
+/* begin-GG-local: explicit register specification for parameters */
+
+/* Initialize a variable CUM of type CUMULATIVE_ARGS
+   for a call to a function whose data type is FNTYPE.
+   For a library call, FNTYPE is 0.  */
+
+void
+amigaos_init_cumulative_args(CUMULATIVE_ARGS *cum, tree fntype)
+{
+  m68k_init_cumulative_args(cum, fntype);
+
+  if (fntype)
+    cum->formal_type=TYPE_ARG_TYPES(fntype);
+  else /* Call to compiler-support function. */
+    cum->formal_type=0;
+}
+
+/* Update the data in CUM to advance over an argument.  */
+
+void
+amigaos_function_arg_advance(CUMULATIVE_ARGS *cum)
+{
+  m68k_function_arg_advance(cum);
+
+  if (cum->formal_type)
+    cum->formal_type=TREE_CHAIN((tree)cum->formal_type);
+}
+
+/* A C expression that controls whether a function argument is passed
+   in a register, and which register. */
+
+struct rtx_def *
+amigaos_function_arg(CUMULATIVE_ARGS *cum, enum machine_mode mode,
+  tree type)
+{
+  tree asmtree;
+  if (cum->formal_type && TREE_VALUE((tree)cum->formal_type)
+      && (asmtree=lookup_attribute("asm",
+			TYPE_ATTRIBUTES(TREE_VALUE((tree)cum->formal_type)))))
+    {
+      int i;
+#if 0
+      /* See c-decl.c/push_parm_decl for an explanation why this doesn't work.
+       */
+      cum->last_arg_reg=TREE_INT_CST_LOW(TREE_VALUE(TREE_VALUE(asmtree)));
+#else
+      cum->last_arg_reg=TREE_INT_CST_LOW(TREE_VALUE(asmtree));
+#endif
+      cum->last_arg_len=HARD_REGNO_NREGS(cum->last_arg_reg, mode);
+
+      for (i=0; i<cum->last_arg_len; i++)
+	if (cum->regs_already_used & (1 << cum->last_arg_reg+i))
+	  {
+	    error("two parameters allocated for one register");
+	    break;
+	  }
+      return gen_rtx(REG, mode, cum->last_arg_reg);
+    }
+  else
+    return (struct rtx_def *)m68k_function_arg(cum, mode, type);
+}
+
+/* Return zero if the attributes on TYPE1 and TYPE2 are incompatible,
+   one if they are compatible, and two if they are nearly compatible
+   (which causes a warning to be generated). */
+
+int
+comp_amigaos_type_attributes(tree type1, tree type2)
+{
+  int ret;
+  if ((ret=comp_m68k_type_attributes(type1, type2))!=1)
+    return ret;
+
+  /* Functions or methods are incompatible if they specify mutually exclusive
+     ways of passing arguments. */
+  if (TREE_CODE(type1)==FUNCTION_TYPE || TREE_CODE(type1)==METHOD_TYPE)
+    {
+      tree arg1, arg2;
+      arg1=TYPE_ARG_TYPES(type1);
+      arg2=TYPE_ARG_TYPES(type2);
+      for (; arg1 && arg2; arg1=TREE_CHAIN(arg1), arg2=TREE_CHAIN(arg2))
+	if (TREE_VALUE(arg1) && TREE_VALUE(arg2))
+	  {
+	    tree asm1, asm2;
+	    asm1=lookup_attribute("asm", TYPE_ATTRIBUTES(TREE_VALUE(arg1)));
+	    asm2=lookup_attribute("asm", TYPE_ATTRIBUTES(TREE_VALUE(arg2)));
+	    if (asm1 && asm2)
+	      {
+		if (TREE_INT_CST_LOW(TREE_VALUE(asm1))!=
+		    TREE_INT_CST_LOW(TREE_VALUE(asm2)))
+		  return 0; /* Two different registers specified. */
+	      }
+	    else
+	      if (asm1 || asm2)
+		return 0; /* "asm" used in only one type. */
+	  }
+    }
+  return 1;
+}
+
+/* end-GG-local */
diff -urNEBb gcc-2.95.3-orig/gcc/config/m68k/amigaos.h gcc-2.95.3/gcc/config/m68k/amigaos.h
--- gcc-2.95.3-orig/gcc/config/m68k/amigaos.h	1970-01-01 01:00:00.000000000 +0100
+++ gcc-2.95.3/gcc/config/m68k/amigaos.h	2003-12-02 17:50:55.000000000 +0100
@@ -0,0 +1,624 @@
+/* Configuration for GNU C-compiler for m68k Amiga, running AmigaOS.
+   Copyright (C) 1992, 93-97, 1998 Free Software Foundation, Inc.
+   Contributed by Markus M. Wild (wild@amiga.physik.unizh.ch).
+   Heavily modified by Kamil Iskra (iskra@student.uci.agh.edu.pl).
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING.  If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#include "m68k/m68k.h"
+
+/* begin-GG-local: explicit register specification for parameters */
+#define TARGET_AMIGAOS
+/* end-GG-local */
+
+/* Specs, switches.  */
+
+/* See m68k.h for bits in TARGET_DEFAULT.
+   0 means 68000, no hardware fpu (68881/68882/68040/68060).  */
+
+#define TARGET_DEFAULT 0
+
+/* Define __HAVE_68881__ in preprocessor according to the -m flags.
+   This will control the use of inline 68881 insns in certain macros.
+   Also inform the program which CPU we compile for.
+   When creating shared libraries, use different 'errno'.  */
+
+/* -msoft-float is the default, assume -mc68000 as well */
+#define CPP_SPEC							\
+  "%{m68881:-D__HAVE_68881__} "						\
+  "%{!ansi:"								\
+    "%{m68020:-Dmc68020} "						\
+    "%{mc68020:-Dmc68020} "						\
+    "%{m68020-40:-Dmc68020} "						\
+    "%{m68020-60:-Dmc68020} "						\
+    "%{m68030:-Dmc68030} "						\
+    "%{m68040:-Dmc68040} "						\
+    "%{m68060:-Dmc68060}} "						\
+  "%{m68020:-D__mc68020__ -D__mc68020} "				\
+  "%{mc68020:-D__mc68020__ -D__mc68020} "				\
+  "%{m68020-40:-D__mc68020__ -D__mc68020} "				\
+  "%{m68020-60:-D__mc68020__ -D__mc68020} "				\
+  "%{m68030:-D__mc68030__ -D__mc68030} "				\
+  "%{m68040:-D__mc68040__ -D__mc68040} "				\
+  "%{m68060:-D__mc68060__ -D__mc68060} "
+
+/* Various -m flags require special flags to the assembler.  */
+
+#define ASM_SPEC "\
+ %{m68000:-mc68010}\
+ %{mc68000:-mc68010}\
+ %{m68020:-mc68020}\
+ %{mc68020:-mc68020}\
+ %{m68030:-mc68030}\
+ %{m68040:-mc68040}\
+ %{m68060:-mc68060}\
+ %{m68020-40:-mc68020}\
+ %{m68020-60:-mc68020}\
+ %{!mc68000:%{!m68000:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68060:%{!m68020-40:%{!m68020-60:-mc68010}}}}}}}}}\
+ %{msmall-code:-sc}\
+"
+
+/* amiga/amigaos are the new "standard" defines for the Amiga.
+ * MCH_AMIGA, AMIGA, __chip etc. are used in other compilers and are
+ * provided for compatibility reasons.  */
+
+#define CPP_PREDEFINES "\
+ -Dmc68000\
+ -Damiga\
+ -Damigaos\
+ -DMCH_AMIGA\
+ -DAMIGA\
+ -D__chip=__attribute__((__chip__))\
+ -D__saveds=__attribute__((__saveds__))\
+ -D__interrupt=__attribute__((__interrupt__))\
+ -D__stackext=__attribute__((__stackext__))\
+ -D__regargs=__attribute__((__regparm__))\
+ -D__stdargs=__attribute__((__stkparm__))\
+ -D__aligned=__attribute__((__aligned__(4)))\
+ -Asystem(amigaos)\
+ -Acpu(m68k)\
+ -Amachine(m68k)\
+"
+
+/* Choose the right startup file, depending on whether we use base relative
+   code, base relative code with automatic relocation (-resident), their
+   32-bit versions, libnix, profiling or plain crt0.o.  */
+
+#define STARTFILE_SPEC			\
+  "%{resident32:nr32crt0.o%s}"		\
+  "%{!resident32:"			\
+    "%{fbaserel32:nb32crt0.o%s}"	\
+    "%{!fbaserel32:"			\
+      "%{resident:nrcrt0.o%s}"		\
+      "%{!resident:"			\
+        "%{fbaserel:nbcrt0.o%s}"	\
+        "%{!fbaserel:ncrt0.o%s}}}} "
+
+#define ENDFILE_SPEC ""
+
+/* Automatically search libamiga.a for AmigaOS specific functions.  Note
+   that we first search the standard C library to resolve as much as
+   possible from there, since it has names that are duplicated in libamiga.a
+   which we *don't* want from there.  Then search libamiga.a for any calls
+   that were not generated inline, and finally search the standard C library
+   again to resolve any references that libamiga.a might have generated.
+   This may only be a temporary solution since it might be better to simply
+   remove the things from libamiga.a that should be pulled in from libc.a
+   instead, which would eliminate the first reference to libc.a.  Note that
+   if we don't search it automatically, it is very easy for the user to try
+   to put in a -lamiga himself and get it in the wrong place, so that (for
+   example) calls like sprintf come from -lamiga rather than -lc. */
+
+#define LIB_SPEC	\
+  "%{mstackextend:-lstack} -lc -lamiga -ldebug -lgcc "
+
+/* If debugging, tell the linker to output amiga-hunk symbols *and* a BSD
+   compatible debug hunk.
+   Also, pass appropriate linker flavours depending on user-supplied
+   commandline options.  */
+
+#define LINK_SPEC							\
+  "%{fbaserel:%{!resident:-m amiga_bss -fl libb}} "			\
+  "%{resident:-m amiga_bss -amiga-datadata-reloc -fl libb} "		\
+  "%{fbaserel32:%{!resident32:-m amiga_bss -fl libb32}} "		\
+  "%{resident32:-m amiga_bss -amiga-datadata-reloc -fl libb32} "	\
+  "%{g:-amiga-debug-hunk} "						\
+  "%{m68020:-fl libm020} "						\
+  "%{mc68020:-fl libm020} "						\
+  "%{m68030:-fl libm020} "						\
+  "%{m68040:-fl libm020} "						\
+  "%{m68060:-fl libm020} "						\
+  "%{m68020-40:-fl libm020} "						\
+  "%{m68020-60:-fl libm020} "						\
+  "%{m68881:-fl libm881} "
+
+/* Translate '-resident' to '-fbaserel' (they differ in linking stage only).
+   Don't put function addresses in registers for PC-relative code.  */
+
+#define CC1_SPEC							\
+  "%{resident:-fbaserel} "						\
+  "%{resident32:-fbaserel32} "						\
+  "%{msmall-code:-fno-function-cse} "
+
+/* Compile with stack extension.  */
+
+#define MASK_STACKEXTEND 0x40000000
+#define TARGET_STACKEXTEND (((target_flags & MASK_STACKEXTEND)		\
+  && !lookup_attribute ("interrupt",					\
+			TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl)))) \
+  || lookup_attribute ("stackext",					\
+		       TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl))))
+
+/* Compile with stack checking.  */
+
+#define MASK_STACKCHECK 0x20000000
+#define TARGET_STACKCHECK ((target_flags & MASK_STACKCHECK)		\
+  && !(target_flags & MASK_STACKEXTEND)					\
+  && !lookup_attribute ("interrupt",					\
+			TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl))) \
+  && !lookup_attribute ("stackext",					\
+			TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl))))
+
+/* Compile with a4 restoring in public functions.  */
+
+#define MASK_RESTORE_A4 0x10000000
+#define TARGET_RESTORE_A4						\
+  ((target_flags & MASK_RESTORE_A4) && TREE_PUBLIC (current_function_decl))
+
+/* Compile with a4 restoring in all functions.  */
+
+#define MASK_ALWAYS_RESTORE_A4 0x8000000
+#define TARGET_ALWAYS_RESTORE_A4 (target_flags & MASK_ALWAYS_RESTORE_A4)
+
+/* Provide a dummy entry for the '-msmall-code' switch.  This is used by
+   the assembler and '*_SPEC'.  */
+
+#undef SUBTARGET_SWITCHES
+#define SUBTARGET_SWITCHES						\
+    { "small-code", 0},							\
+    { "stackcheck", MASK_STACKCHECK},					\
+    { "no-stackcheck", - MASK_STACKCHECK},				\
+    { "stackextend", MASK_STACKEXTEND},					\
+    { "no-stackextend", - MASK_STACKEXTEND},				\
+    { "fixedstack", - (MASK_STACKCHECK|MASK_STACKEXTEND)},		\
+    { "restore-a4", MASK_RESTORE_A4},					\
+    { "no-restore-a4", - MASK_RESTORE_A4},				\
+    { "always-restore-a4", MASK_ALWAYS_RESTORE_A4},			\
+    { "no-always-restore-a4", - MASK_ALWAYS_RESTORE_A4},
+
+#undef SUBTARGET_OVERRIDE_OPTIONS
+#define SUBTARGET_OVERRIDE_OPTIONS					\
+do									\
+  {									\
+    if (!TARGET_68020 && flag_pic==4)					\
+      error ("-fbaserel32 is not supported on the 68000 or 68010\n");	\
+  }									\
+while (0)
+
+/* Various ABI issues.  */
+
+/* This is (almost;-) BSD, so it wants DBX format.  */
+
+#define DBX_DEBUGGING_INFO
+
+/* GDB goes mad if it sees the function end marker.  */
+
+#define NO_DBX_FUNCTION_END 1
+
+/* Allow folding division by zero.  */
+
+#define REAL_INFINITY
+
+/* Don't try using XFmode since we don't have appropriate runtime software
+   support.  */
+#undef LONG_DOUBLE_TYPE_SIZE
+#define LONG_DOUBLE_TYPE_SIZE 64
+
+/* Use A5 as framepointer instead of A6, since the AmigaOS ABI requires A6
+   to be used as a shared library base pointer in direct library calls.  */
+
+#undef FRAME_POINTER_REGNUM
+#define FRAME_POINTER_REGNUM 13
+#undef ARG_POINTER_REGNUM
+#define ARG_POINTER_REGNUM 13
+
+/* We use A4 for the PIC pointer, not A5, which is the framepointer.  */
+
+#undef PIC_OFFSET_TABLE_REGNUM
+#define PIC_OFFSET_TABLE_REGNUM 12
+
+/* The AmigaOS ABI does not define how structures should be returned, so,
+   contrary to 'm68k.h', we prefer a multithread-safe solution.  */
+
+#undef PCC_STATIC_STRUCT_RETURN
+
+/* Setup a default shell return value for those (gazillion..) programs that
+   (inspite of ANSI-C) declare main() to be void (or even VOID...) and thus
+   cause the shell to randomly caugh upon executing such programs (contrary
+   to Unix, AmigaOS scripts are terminated with an error if a program returns
+   with an error code above the `error' or even `failure' level
+   (which is configurable with the FAILAT command)).  */
+
+#define DEFAULT_MAIN_RETURN c_expand_return (integer_zero_node)
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "unsigned int"
+
+/* Support sections in chip memory, currently '.datachip' only.  */
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC)		\
+  fprintf ((FILE), "\t%s\n", (NAME))
+
+/* We define ASM_OUTPUT_SECTON_NAME, but we don't support arbitrary sections,
+   including '.gcc_except_table', so we emulate the standard behaviour.  */
+#define EXCEPTION_SECTION()						\
+do									\
+  {									\
+    if (flag_pic)							\
+      data_section ();							\
+    else								\
+      readonly_data_section ();						\
+  }									\
+while(0)
+
+#define EH_FRAME_SECTION() readonly_data_section ()
+
+/* Use sjlj exceptions until problems with DWARF2 unwind info on a.out
+   targets using GNU ld are fixed.  */
+#define DWARF2_UNWIND_INFO	0
+
+/* GAS supports alignment up to 32768 bytes.  */
+#undef ASM_OUTPUT_ALIGN
+#define ASM_OUTPUT_ALIGN(FILE, LOG)					\
+do									\
+  {									\
+    if ((LOG) == 1)							\
+      fprintf ((FILE), "\t.even\n");					\
+    else								\
+      fprintf ((FILE), "\t.align %d\n", (LOG));				\
+  }									\
+while (0)
+
+#define MAX_OFILE_ALIGNMENT ((1 << 15)*BITS_PER_UNIT)
+
+/* It is not uncommon to use a custom startup code on AmigaOS.  The OS
+   starts an application by jumping to the first byte of the text section,
+   so we prefer the constants to be put after the functions.  */
+/* FIXME: Disabled for now, it's buggy.  */
+
+/* #define CONSTANT_AFTER_FUNCTION_P(EXP) 1 */ /**/
+
+/* Call __flush_cache() after building the trampoline: it will call
+   an appropriate OS cache-clearing routine.  */
+
+#undef FINALIZE_TRAMPOLINE
+#define FINALIZE_TRAMPOLINE(TRAMP)					\
+  emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__flush_cache"),	\
+		     0, VOIDmode, 2, (TRAMP), Pmode,			\
+		     GEN_INT (TRAMPOLINE_SIZE), SImode)
+
+/* Baserel support.  */
+
+/* Given that symbolic_operand(X), return TRUE if no special
+   base relative relocation is necessary */
+
+#define LEGITIMATE_BASEREL_OPERAND_P(X)					\
+  (flag_pic >= 3 && read_only_operand (X))
+
+#undef LEGITIMATE_PIC_OPERAND_P
+#define LEGITIMATE_PIC_OPERAND_P(X)					\
+  (! symbolic_operand (X, VOIDmode) || LEGITIMATE_BASEREL_OPERAND_P (X))
+
+/* Define this macro if references to a symbol must be treated
+   differently depending on something about the variable or
+   function named by the symbol (such as what section it is in).
+
+   The macro definition, if any, is executed immediately after the
+   rtl for DECL or other node is created.
+   The value of the rtl will be a `mem' whose address is a
+   `symbol_ref'.
+
+   The usual thing for this macro to do is to a flag in the
+   `symbol_ref' (such as `SYMBOL_REF_FLAG') or to store a modified
+   name string in the `symbol_ref' (if one bit is not enough
+   information).
+
+   On the Amiga we use this to indicate if references to a symbol should be
+   absolute or base relative.  */
+
+#define ENCODE_SECTION_INFO(DECL)					\
+do									\
+  {									\
+    if (TREE_CODE (DECL) == FUNCTION_DECL)				\
+      SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1;			\
+    else								\
+      {									\
+	rtx rtl = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd'		\
+		   ? TREE_CST_RTL (DECL) : DECL_RTL (DECL));		\
+	if ((RTX_UNCHANGING_P (rtl) && !MEM_VOLATILE_P (rtl)		\
+	     && (flag_pic<3 || (TREE_CODE (DECL) == STRING_CST		\
+				&& !flag_writable_strings)		\
+		 || amigaos_put_in_text (DECL)))			\
+	    || (TREE_CODE (DECL) == VAR_DECL				\
+		&& DECL_SECTION_NAME (DECL) != NULL_TREE))		\
+	  SYMBOL_REF_FLAG (XEXP (rtl, 0)) = 1;				\
+      }									\
+  }									\
+while (0)
+
+#define LIBCALL_ENCODE_SECTION_INFO(FUN)				\
+do									\
+  {									\
+    if (flag_pic >= 3)							\
+      SYMBOL_REF_FLAG (FUN) = 1;					\
+  }									\
+while (0)
+
+/* according to varasm.c, RELOC referrs *only* to whether constants (!)
+   are addressed by address. */
+
+#undef SELECT_SECTION
+#define SELECT_SECTION(DECL, RELOC)					\
+{									\
+  if (TREE_CODE (DECL) == STRING_CST)					\
+    {									\
+      if (! flag_writable_strings)					\
+	readonly_data_section ();					\
+      else								\
+	data_section ();						\
+    }									\
+  else if (TREE_CODE (DECL) == VAR_DECL)				\
+    {									\
+      if (TREE_READONLY (DECL)						\
+	  && ! TREE_THIS_VOLATILE (DECL)				\
+	  && DECL_INITIAL (DECL)					\
+	  && (DECL_INITIAL (DECL) == error_mark_node			\
+	      || TREE_CONSTANT (DECL_INITIAL (DECL)))			\
+	  && (!flag_pic || (flag_pic<3 && !RELOC)			\
+	      || SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0))))		\
+	readonly_data_section ();					\
+      else								\
+	data_section ();						\
+    }									\
+  else if ((!flag_pic || (flag_pic<3 && !RELOC))			\
+	   && SYMBOL_REF_FLAG (XEXP ((TREE_CODE_CLASS (TREE_CODE (DECL))\
+		!= 'd' ? TREE_CST_RTL (DECL) : DECL_RTL (DECL)), 0)))	\
+    readonly_data_section ();						\
+  else									\
+    data_section ();							\
+}
+
+/* Preserve the initial value of a4.  */
+
+#define PROLOGUE_EXTRA_SAVE(MASK, NUM_SAVED_REGS)			\
+do									\
+  {									\
+    if (amigaos_restore_a4 ())						\
+      {									\
+	(MASK) |= 1 << (15 - PIC_OFFSET_TABLE_REGNUM);			\
+	(NUM_SAVED_REGS)++;						\
+      }									\
+  }									\
+while (0)
+
+/* Restore the initial value of a4.  */
+
+#define EPILOGUE_EXTRA_RESTORE(MASK, NREGS)				\
+do									\
+  {									\
+    if (amigaos_restore_a4 ())						\
+      {									\
+	(MASK) |= 1 << PIC_OFFSET_TABLE_REGNUM;				\
+	(NREGS)++;							\
+      }									\
+  }									\
+while (0)
+
+#define HAVE_ALTERNATE_PIC_SETUP (flag_pic >= 3)
+
+/* Make a4 point at data hunk.  */
+
+void amigaos_alternate_pic_setup ();
+#define ALTERNATE_PIC_SETUP(STREAM)					\
+  (amigaos_alternate_pic_setup (STREAM))
+
+/* If preserving a4, let the code generator know about it.  */
+
+#undef SUBTARGET_INITIAL_FP_OFFSET
+#define SUBTARGET_INITIAL_FP_OFFSET(OFFSET)				\
+do									\
+  {									\
+    if (amigaos_restore_a4 ())						\
+      (OFFSET) += 4;							\
+  }									\
+while (0)
+
+/* Determine if the epilogue should be output as RTL.
+   Don't do it if preserving a4.  */
+
+#undef USE_RETURN_INSN
+#define USE_RETURN_INSN (use_return_insn () && ! amigaos_restore_a4 ())
+
+/* Attribute support.  */
+
+/* A C expression whose value is nonzero if IDENTIFIER with arguments
+   ARGS is a valid machine specific attribute for DECL.  The attributes
+   in ATTRIBUTES have previously been assigned to DECL.  */
+
+#define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, IDENTIFIER, ARGS) \
+  (valid_amigaos_decl_attribute ((DECL), (IDENTIFIER)))
+
+/* A C expression whose value is nonzero if IDENTIFIER with arguments
+   ARGS is a valid machine specific attribute for TYPE.  The attributes
+   in ATTRIBUTES have previously been assigned to TYPE.  */
+
+#undef VALID_MACHINE_TYPE_ATTRIBUTE
+#define VALID_MACHINE_TYPE_ATTRIBUTE(TYPE, ATTRIBUTES, IDENTIFIER, ARGS) \
+  (valid_amigaos_type_attribute ((TYPE), (ATTRIBUTES), (IDENTIFIER), (ARGS)))
+
+/* Generate the test of d0 before return to set cc register in 'interrupt'
+   function.  */
+
+#define EPILOGUE_END_HOOK(STREAM)					\
+do									\
+  {									\
+    if (lookup_attribute ("interrupt",					\
+			  TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl)))) \
+      asm_fprintf ((STREAM), "\ttstl %Rd0\n");				\
+  }									\
+while (0)
+
+/* begin-GG-local: explicit register specification for parameters */
+
+/* Note: this is an extension of m68k_args */
+struct amigaos_args
+{
+  int num_of_regs;
+  long regs_already_used;
+  int last_arg_reg;
+  int last_arg_len;
+  void *formal_type; /* New field: formal type of the current argument.  */
+};
+
+/* A C type for declaring a variable that is used as the first
+   argument of `FUNCTION_ARG' and other related values.  */
+
+#undef CUMULATIVE_ARGS
+#define CUMULATIVE_ARGS struct amigaos_args
+
+/* Initialize a variable CUM of type CUMULATIVE_ARGS
+   for a call to a function whose data type is FNTYPE.
+   For a library call, FNTYPE is 0.  */
+
+#undef INIT_CUMULATIVE_ARGS
+#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT)		\
+  (amigaos_init_cumulative_args(&(CUM), (FNTYPE)))
+
+/* Update the data in CUM to advance over an argument
+   of mode MODE and data type TYPE.
+   (TYPE is null for libcalls where that information may not be available.)  */
+
+#undef FUNCTION_ARG_ADVANCE
+#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)			\
+  (amigaos_function_arg_advance (&(CUM)))
+
+/* A C expression that controls whether a function argument is passed
+   in a register, and which register. */
+
+#undef FUNCTION_ARG
+#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
+  ((struct rtx_def *)amigaos_function_arg (&(CUM), (MODE), (TYPE)))
+
+/* A C expression whose value is zero if the attributes on TYPE1 and
+   TYPE2 are incompatible, one if they are compatible, and two if they
+   are nearly compatible (which causes a warning to be generated).  */
+
+#undef COMP_TYPE_ATTRIBUTES
+#define COMP_TYPE_ATTRIBUTES(TYPE1, TYPE2) 				\
+  (comp_amigaos_type_attributes ((TYPE1), (TYPE2)))
+
+/* end-GG-local */
+
+/* Stack checking and automatic extension support.  */
+
+void amigaos_prologue_begin_hook ();
+#define PROLOGUE_BEGIN_HOOK(STREAM, FSIZE)				\
+  (amigaos_prologue_begin_hook ((STREAM), (FSIZE)))
+
+#define HAVE_ALTERNATE_FRAME_SETUP_F(FSIZE) TARGET_STACKEXTEND
+
+void amigaos_alternate_frame_setup_f ();
+#define ALTERNATE_FRAME_SETUP_F(STREAM, FSIZE)				\
+  (amigaos_alternate_frame_setup_f ((STREAM), (FSIZE)))
+
+#define HAVE_ALTERNATE_FRAME_SETUP(FSIZE) TARGET_STACKEXTEND
+
+void amigaos_alternate_frame_setup ();
+#define ALTERNATE_FRAME_SETUP(STREAM, FSIZE)				\
+  (amigaos_alternate_frame_setup ((STREAM), (FSIZE)))
+
+#define HAVE_ALTERNATE_FRAME_DESTR_F(FSIZE)				\
+  (TARGET_STACKEXTEND && current_function_calls_alloca)
+
+#define ALTERNATE_FRAME_DESTR_F(STREAM, FSIZE)				\
+  (asm_fprintf ((STREAM), "\tjra %U__unlk_a5_rts\n"))
+
+#define HAVE_ALTERNATE_RETURN						\
+  (TARGET_STACKEXTEND && frame_pointer_needed &&			\
+   current_function_calls_alloca)
+
+#define ALTERNATE_RETURN(STREAM)
+
+struct rtx_def* gen_stack_cleanup_call ();
+#define HAVE_restore_stack_nonlocal TARGET_STACKEXTEND
+#define gen_restore_stack_nonlocal gen_stack_cleanup_call
+
+#define HAVE_restore_stack_function TARGET_STACKEXTEND
+#define gen_restore_stack_function gen_stack_cleanup_call
+
+#define HAVE_restore_stack_block TARGET_STACKEXTEND
+#define gen_restore_stack_block gen_stack_cleanup_call
+
+#undef TARGET_ALTERNATE_ALLOCATE_STACK
+#define TARGET_ALTERNATE_ALLOCATE_STACK 1
+
+#define ALTERNATE_ALLOCATE_STACK(OPERANDS)				\
+do									\
+  {									\
+    amigaos_alternate_allocate_stack (OPERANDS);			\
+    DONE;								\
+  }									\
+while (0)
+
+/* begin-GG-local: dynamic libraries */
+
+#if defined(__amigaos__)
+
+/* This macro is used to check if all collect2 facilities should be used.
+   We need a few special ones, like stripping after linking.  */
+
+#define DO_COLLECTING (do_collecting || amigaos_do_collecting())
+
+/* This macro is called in collect2 for every GCC argument name.
+   ARG is a part of commandline (without '\0' at the end).  */
+
+#define COLLECT2_GCC_OPTIONS_HOOK(ARG) amigaos_gccopts_hook(ARG)
+
+/* This macro is called in collect2 for every ld's "-l" or "*.o" or "*.a"
+   argument.  ARG is a complete argument, with '\0' at the end.  */
+
+#define COLLECT2_LIBNAME_HOOK(ARG) amigaos_libname_hook(ARG)
+
+/* This macro is called at collect2 exit, to clean everything up.  */
+
+#define COLLECT2_EXTRA_CLEANUP amigaos_collect2_cleanup
+
+/* This macro is called just before the first linker invocation.
+   LD1_ARGV is "char** argv", which will be passed to "ld".  STRIP is an
+   *address* of "strip_flag" variable.  */
+
+#define COLLECT2_PRELINK_HOOK(LD1_ARGV, STRIP) \
+amigaos_prelink_hook((LD1_ARGV), (STRIP))
+
+/* This macro is called just after the first linker invocation, in place of
+   "nm" and "ldd".  OUTPUT_FILE is the executable's filename.  */
+
+#define COLLECT2_POSTLINK_HOOK(OUTPUT_FILE) amigaos_postlink_hook(OUTPUT_FILE)
+
+#endif /* __amigaos__ */
+
+/* end-GG-local */
diff -urNEBb gcc-2.95.3-orig/gcc/config/m68k/m68k.c gcc-2.95.3/gcc/config/m68k/m68k.c
--- gcc-2.95.3-orig/gcc/config/m68k/m68k.c	1999-08-02 06:51:08.000000000 +0200
+++ gcc-2.95.3/gcc/config/m68k/m68k.c	2003-12-02 17:50:55.000000000 +0100
@@ -63,6 +63,8 @@
 const char *m68k_align_jumps_string;
 /* Specify power of two alignment used for functions. */
 const char *m68k_align_funcs_string;
+/* Specify number of registers for integer, pointer and float arguments.  */
+const char *m68k_regparm_string;
 
 /* Specify power of two alignment used for loops. */
 int m68k_align_loops;
@@ -70,6 +72,8 @@
 int m68k_align_jumps;
 /* Specify power of two alignment used for functions. */
 int m68k_align_funcs;
+/* Specify number of registers for integer, pointer and float arguments.  */
+int m68k_regparm;
 
 /* Nonzero if the last compare/test insn had FP operands.  The
    sCC expanders peek at this to determine what to do for the
@@ -124,6 +128,19 @@
     }
   else
     m68k_align_funcs = def_align;
+
+  /* Validate -mregparm and -mregparm= value.  */
+  if (m68k_regparm_string)
+    {
+      m68k_regparm = atoi (m68k_regparm_string);
+      if (m68k_regparm < 1 || m68k_regparm > M68K_MAX_REGPARM)
+	fatal ("-mregparm=%d is not between 1 and %d",
+	       m68k_regparm, M68K_MAX_REGPARM);
+      target_flags |= MASK_REGPARM;
+    }
+  else
+    if (TARGET_REGPARM)
+      m68k_regparm = M68K_DEFAULT_REGPARM;
 }
 
 /* This function generates the assembly code for function entry.
@@ -151,9 +168,17 @@
   int fsize = (size + 3) & -4;
   int cfa_offset = INCOMING_FRAME_SP_OFFSET, cfa_store_offset = cfa_offset;
   
+#ifdef PROLOGUE_BEGIN_HOOK
+  PROLOGUE_BEGIN_HOOK (stream, fsize);
+#endif
 
   if (frame_pointer_needed)
     {
+#ifdef HAVE_ALTERNATE_FRAME_SETUP_F
+      if (HAVE_ALTERNATE_FRAME_SETUP_F (fsize))
+	ALTERNATE_FRAME_SETUP_F (stream, fsize);
+      else
+#endif
       if (fsize == 0 && TARGET_68040)
 	{
 	/* on the 68040, pea + move is faster than link.w 0 */
@@ -209,6 +234,10 @@
 	  cfa_store_offset += fsize;
 	}
     }
+#ifdef HAVE_ALTERNATE_FRAME_SETUP
+  else if (HAVE_ALTERNATE_FRAME_SETUP (fsize))
+    ALTERNATE_FRAME_SETUP (stream, fsize);
+#endif
   else if (fsize)
     {
       if (fsize + 4 < 0x8000)
@@ -356,11 +385,14 @@
       mask &= ~ (1 << (15 - FRAME_POINTER_REGNUM));
       num_saved_regs--;
     }
-  if (flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM])
+  if (flag_pic && flag_pic < 3 && regs_ever_live[PIC_OFFSET_TABLE_REGNUM])
     {
       mask |= 1 << (15 - PIC_OFFSET_TABLE_REGNUM);
       num_saved_regs++;
     }
+#ifdef PROLOGUE_EXTRA_SAVE
+  PROLOGUE_EXTRA_SAVE (mask, num_saved_regs);
+#endif
 
 #if NEED_PROBE
 #ifdef MOTOROLA
@@ -462,6 +494,11 @@
 				  -cfa_store_offset + n_regs++ * 4);
 	}
     }
+#ifdef HAVE_ALTERNATE_PIC_SETUP
+  if (HAVE_ALTERNATE_PIC_SETUP)
+    ALTERNATE_PIC_SETUP (stream);
+  else
+#endif
   if (flag_pic && current_function_uses_pic_offset_table)
     {
 #ifdef MOTOROLA
@@ -568,11 +605,14 @@
         nregs++;
 	mask |= 1 << regno;
       }
-  if (flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM])
+  if (flag_pic && flag_pic < 3 && regs_ever_live[PIC_OFFSET_TABLE_REGNUM])
     {
       nregs++;
       mask |= 1 << PIC_OFFSET_TABLE_REGNUM;
     }
+#ifdef EPILOGUE_EXTRA_RESTORE
+  EPILOGUE_EXTRA_RESTORE (mask, nregs);
+#endif
   offset = foffset + nregs * 4;
   /* FIXME : leaf_function_p below is too strong.
      What we really need to know there is if there could be pending
@@ -759,6 +799,11 @@
 	  fpoffset -= 8;
 	}
   if (frame_pointer_needed)
+#ifdef HAVE_ALTERNATE_FRAME_DESTR_F
+    if (HAVE_ALTERNATE_FRAME_DESTR_F (fsize))
+      ALTERNATE_FRAME_DESTR_F (stream, fsize);
+    else
+#endif
     fprintf (stream, "\tunlk %s\n",
 	     reg_names[FRAME_POINTER_REGNUM]);
   else if (fsize)
@@ -828,9 +873,19 @@
 #endif
 	}
     }
+
+#ifdef EPILOGUE_END_HOOK
+  EPILOGUE_END_HOOK (stream);
+#endif
+
   if (current_function_pops_args)
     asm_fprintf (stream, "\trtd %0I%d\n", current_function_pops_args);
   else
+#ifdef HAVE_ALTERNATE_RETURN
+    if (HAVE_ALTERNATE_RETURN)
+      ALTERNATE_RETURN (stream);
+    else
+#endif
     fprintf (stream, "\trts\n");
 }
 
@@ -1327,12 +1382,20 @@
   /* First handle a simple SYMBOL_REF or LABEL_REF */
   if (GET_CODE (orig) == SYMBOL_REF || GET_CODE (orig) == LABEL_REF)
     {
+#ifdef LEGITIMATE_BASEREL_OPERAND_P
+      if (LEGITIMATE_BASEREL_OPERAND_P (orig))
+	return orig;
+#endif
+
       if (reg == 0)
 	abort ();
 
+      if (flag_pic < 3)
       pic_ref = gen_rtx_MEM (Pmode,
 			     gen_rtx_PLUS (Pmode,
 					   pic_offset_table_rtx, orig));
+      else
+	pic_ref = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, orig);
       current_function_uses_pic_offset_table = 1;
       if (reload_in_progress)
 	regs_ever_live[PIC_OFFSET_TABLE_REGNUM] = 1;
@@ -3104,6 +3167,10 @@
 	          fprintf (file, ":w");
 	        if ((flag_pic == 2) && (breg == pic_offset_table_rtx))
 	          fprintf (file, ":l");
+		if ((flag_pic == 3) && (breg == pic_offset_table_rtx))
+		  fprintf (file, ":W");
+		if ((flag_pic == 4) && (breg == pic_offset_table_rtx))
+		  fprintf (file, ":L");
 	      }
 	    if (addr != 0 && ireg != 0)
 	      {
@@ -3280,6 +3347,252 @@
 	  && (INTVAL (op) >= (-0x7fffffff - 1) && INTVAL (op) <= 0x7fffffff));
 }
 
+/* Argument-passing support functions.  */
+
+/* Initialize a variable CUM of type CUMULATIVE_ARGS
+   for a call to a function whose data type is FNTYPE.
+   For a library call, FNTYPE is 0.  */
+
+void
+m68k_init_cumulative_args (cum, fntype)
+     CUMULATIVE_ARGS *cum;
+     tree fntype;
+{
+  cum->last_arg_reg = -1;
+  cum->regs_already_used = 0;
+  if (fntype)
+    {
+      if (lookup_attribute ("stkparm", TYPE_ATTRIBUTES (fntype)))
+	cum->num_of_regs = 0;
+      else
+	{
+	  tree ratree = lookup_attribute ("regparm", TYPE_ATTRIBUTES (fntype));
+	  if (ratree)
+	    {
+	      cum->num_of_regs = m68k_regparm ? m68k_regparm
+					      : M68K_DEFAULT_REGPARM;
+	      if (TREE_VALUE (ratree)
+		  && TREE_CODE (TREE_VALUE (ratree)) == TREE_LIST)
+		{
+		  tree num_of_regs = TREE_VALUE (TREE_VALUE (ratree));
+		  cum->num_of_regs =
+		    num_of_regs ? TREE_INT_CST_LOW (num_of_regs) :
+		      (m68k_regparm ? m68k_regparm : M68K_DEFAULT_REGPARM);
+		}
+	    }
+	  else
+	    cum->num_of_regs = m68k_regparm;
+	}
+    }
+  else /* Libcall.  */
+    cum->num_of_regs = 0;
+
+  if (cum->num_of_regs)
+    {
+      /* If this is a vararg call, put all arguments on stack.  */
+      tree param, next_param;
+      for (param = TYPE_ARG_TYPES (fntype); param; param = next_param)
+	{
+	  next_param = TREE_CHAIN (param);
+	  if (!next_param && TREE_VALUE (param) != void_type_node)
+	    cum->num_of_regs = 0;
+	}
+    }
+
+#if ! defined (PCC_STATIC_STRUCT_RETURN) && defined (STRUCT_VALUE_REGNUM)
+  /* If return value is a structure, and we pass the buffer address in a
+     register, we can't use this register for our own purposes.
+     FIXME: Something similar would be useful for static chain.  */
+  if (fntype && aggregate_value_p (TREE_TYPE (fntype)))
+    cum->regs_already_used |= (1 << STRUCT_VALUE_REGNUM);
+#endif
+}
+
+/* Update the data in CUM to advance over an argument.  */
+
+void
+m68k_function_arg_advance (cum)
+     CUMULATIVE_ARGS *cum;
+{
+  if (cum->last_arg_reg != -1)
+    {
+      int count;
+      for (count = 0; count < cum->last_arg_len; count++)
+	cum->regs_already_used |= (1 << (cum->last_arg_reg + count));
+      cum->last_arg_reg = -1;
+    }
+}
+
+/* Define where to put the arguments to a function.
+   Value is zero to push the argument on the stack,
+   or a hard register in which to store the argument.
+
+   MODE is the argument's machine mode.
+   TYPE is the data type of the argument (as a tree).
+    This is null for libcalls where that information may
+    not be available.
+   CUM is a variable of type CUMULATIVE_ARGS which gives info about
+    the preceding args and about the function being called.  */
+
+struct rtx_def *
+m68k_function_arg (cum, mode, type)
+     CUMULATIVE_ARGS *cum;
+     enum machine_mode mode;
+     tree type;
+{
+  if (cum->num_of_regs)
+    {
+      int regbegin = -1, altregbegin = -1, len;
+
+      /* FIXME: The last condition below is a workaround for a bug.  */
+      if (TARGET_68881 && FLOAT_MODE_P (mode) &&
+	  GET_MODE_UNIT_SIZE (mode) <= 12 &&
+	  (GET_MODE_CLASS (mode) != MODE_COMPLEX_FLOAT || mode == SCmode))
+	{
+	  regbegin = 16; /* FPx */
+	  len = GET_MODE_NUNITS (mode);
+	}
+      /* FIXME: Two last conditions below are workarounds for bugs.  */
+      else if (INTEGRAL_MODE_P (mode) && mode !=CQImode && mode != CHImode)
+	{
+	  if (POINTER_TYPE_P (type))
+	    regbegin = 8; /* Ax */
+	  else
+	    regbegin = 0; /* Dx */
+	  altregbegin = 8 - regbegin;
+	  len = (GET_MODE_SIZE (mode) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD;
+	}
+
+      if (regbegin != -1)
+	{
+	  int reg;
+	  long mask;
+
+look_for_reg:
+	  mask = 1 << regbegin;
+	  for (reg = 0; reg < cum->num_of_regs; reg++, mask <<= 1)
+	    if (!(cum->regs_already_used & mask))
+	      {
+		int end;
+		for (end = reg; end < cum->num_of_regs && end < reg + len;
+		     end++, mask <<= 1)
+		  if (cum->regs_already_used & mask)
+		    break;
+		if (end == reg + len)
+		  {
+		    cum->last_arg_reg = reg + regbegin;
+		    cum->last_arg_len = len;
+		    break;
+		  }
+	      }
+
+	  if (reg == cum->num_of_regs && altregbegin != -1)
+	    {
+	      regbegin = altregbegin;
+	      altregbegin = -1;
+	      goto look_for_reg;
+	    }
+	}
+
+      if (cum->last_arg_reg != -1)
+	return gen_rtx (REG, mode, cum->last_arg_reg);
+    }
+  return 0;
+}
+
+/* Attributes support.  */
+
+/* Return nonzero if IDENTIFIER with arguments ARGS is a valid machine
+   specific attribute for TYPE.  The attributes in ATTRIBUTES have previously
+   been assigned to TYPE.  */
+
+int
+valid_m68k_type_attribute (type, attributes, identifier, args)
+     tree type, attributes, identifier, args;
+{
+  if (TREE_CODE (type) == FUNCTION_TYPE || TREE_CODE (type) == METHOD_TYPE)
+    {
+      /* 'regparm' accepts one optional argument - number of registers in
+	 single class that should be used to pass arguments.  */
+      if (is_attribute_p ("regparm", identifier))
+	{
+	  if (lookup_attribute ("stkparm", attributes))
+	    {
+	      error ("`regparm' and `stkparm' are mutually exclusive");
+	      return 0;
+	    }
+	  if (args && TREE_CODE (args) == TREE_LIST)
+	    {
+	      tree numofregs = TREE_VALUE (args);
+	      if (numofregs)
+		if (TREE_CODE (numofregs) != INTEGER_CST
+		    || TREE_INT_CST_HIGH (numofregs)
+		    || TREE_INT_CST_LOW (numofregs) < 1
+		    || TREE_INT_CST_LOW (numofregs) > M68K_MAX_REGPARM)
+		  {
+		    error ("invalid argument to `regparm' attribute");
+		    return 0;
+		  }
+	    }
+	  return 1;
+	}
+      if (is_attribute_p ("stkparm", identifier))
+	{
+	  if (lookup_attribute ("regparm", attributes))
+	    {
+	      error ("`regparm' and `stkparm' are mutually exclusive");
+	      return 0;
+	    }
+	  return 1;
+	}
+    }
+
+  return 0;
+}
+
+/* Return zero if the attributes on TYPE1 and TYPE2 are incompatible,
+   one if they are compatible, and two if they are nearly compatible
+   (which causes a warning to be generated). */
+
+int
+comp_m68k_type_attributes (type1, type2)
+     tree type1, type2;
+{
+  /* Functions or methods are incompatible if they specify mutually
+     exclusive ways of passing arguments.  */
+  if (TREE_CODE (type1) == FUNCTION_TYPE || TREE_CODE (type1) == METHOD_TYPE)
+    {
+      tree arg1, arg2;
+      if (!! lookup_attribute ("stkparm", TYPE_ATTRIBUTES (type1)) !=
+	     !! lookup_attribute ("stkparm", TYPE_ATTRIBUTES (type2))
+	  || !! lookup_attribute ("regparm", TYPE_ATTRIBUTES (type1)) !=
+	     !! lookup_attribute ("regparm", TYPE_ATTRIBUTES (type2)))
+	return 0; /* 'regparm' and 'stkparm' are mutually exclusive.  */
+
+      arg1 = lookup_attribute ("regparm", TYPE_ATTRIBUTES (type1));
+      arg2 = lookup_attribute ("regparm", TYPE_ATTRIBUTES (type2));
+      if (arg1 && arg2)
+	{
+	  int num1 = 0, num2 = 0;
+	  if (TREE_VALUE (arg1) && TREE_CODE (TREE_VALUE (arg1)) == TREE_LIST)
+	    {
+	      tree numofregs = TREE_VALUE (TREE_VALUE (arg1));
+	      if (numofregs)
+		num1 = TREE_INT_CST_LOW (numofregs);
+	    }
+	  if (TREE_VALUE (arg2) && TREE_CODE (TREE_VALUE (arg2)) == TREE_LIST)
+	    {
+	      tree numofregs = TREE_VALUE (TREE_VALUE (arg2));
+	      if (numofregs)
+		num2 = TREE_INT_CST_LOW (numofregs);
+	    }
+	  if (num1 != num2)
+	    return 0; /* Different numbers, or no number in one type.  */
+	}
+    }
+  return 1;
+}
+
 char *
 output_andsi3 (operands)
      rtx *operands;
diff -urNEBb gcc-2.95.3-orig/gcc/config/m68k/m68k.h gcc-2.95.3/gcc/config/m68k/m68k.h
--- gcc-2.95.3-orig/gcc/config/m68k/m68k.h	2001-01-25 15:03:34.000000000 +0100
+++ gcc-2.95.3/gcc/config/m68k/m68k.h	2003-12-02 17:50:55.000000000 +0100
@@ -68,10 +68,8 @@
 #define MASK_RTD	8
 #define TARGET_RTD (target_flags & MASK_RTD)
 
-/* Compile passing first two args in regs 0 and 1.
-   This exists only to test compiler features that will
-   be needed for RISC chips.  It is not usable
-   and is not intended to be usable on this cpu.  */
+/* Compile using the first 'm68k_regparm' data, address and float
+   registers for arguments passing.  */
 #define MASK_REGPARM	16
 #define TARGET_REGPARM (target_flags & MASK_REGPARM)
 
@@ -155,9 +153,9 @@
     { "68881", MASK_68881},						\
     { "soft-float", - (MASK_FPA|MASK_SKY|MASK_68040_ONLY|MASK_68881)},	\
     { "68020-40", -(MASK_5200|MASK_68060|MASK_68040_ONLY)},		\
-    { "68020-40", (MASK_BITFIELD|MASK_68881|MASK_68020|MASK_68040)},	\
+    { "68020-40", (MASK_BITFIELD|MASK_68020|MASK_68040)},	/* ZZZ olsen */	\
     { "68020-60", -(MASK_5200|MASK_68040_ONLY)},			\
-    { "68020-60", (MASK_BITFIELD|MASK_68881|MASK_68020|MASK_68040	\
+    { "68020-60", (MASK_BITFIELD|MASK_68020|MASK_68040	/* ZZZ olsen */	\
 		   |MASK_68060)},					\
     { "68030", - (MASK_5200|MASK_68060|MASK_68040|MASK_68040_ONLY)},	\
     { "68030", (MASK_68020|MASK_BITFIELD)},				\
@@ -182,6 +180,8 @@
     { "cpu32", MASK_68020},						\
     { "align-int", MASK_ALIGN_INT },					\
     { "no-align-int", -MASK_ALIGN_INT },				\
+    { "regparm", MASK_REGPARM},						\
+    { "no-regparm", - MASK_REGPARM},					\
     SUBTARGET_SWITCHES							\
     { "", TARGET_DEFAULT}}
 /* TARGET_DEFAULT is defined in sun*.h and isi.h, etc.  */
@@ -199,6 +199,7 @@
 { { "align-loops=",	&m68k_align_loops_string },			\
   { "align-jumps=",	&m68k_align_jumps_string },			\
   { "align-functions=",	&m68k_align_funcs_string },			\
+  { "regparm=",		&m68k_regparm_string },				\
   SUBTARGET_OPTIONS							\
 }
 
@@ -809,7 +810,7 @@
 #ifndef SUPPORT_SUN_FPA
 
 #define CLASS_MAX_NREGS(CLASS, MODE)	\
- ((CLASS) == FP_REGS ? 1 \
+ ((CLASS) == FP_REGS ? GET_MODE_NUNITS (MODE) \
   : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
 
 /* Moves between fp regs and other regs are two insns.  */
@@ -821,7 +822,8 @@
 #else /* defined SUPPORT_SUN_FPA */
 
 #define CLASS_MAX_NREGS(CLASS, MODE)	\
- ((CLASS) == FP_REGS || (CLASS) == FPA_REGS || (CLASS) == LO_FPA_REGS ? 1 \
+ ((CLASS) == FP_REGS || (CLASS) == FPA_REGS || (CLASS) == LO_FPA_REGS ?	\
+   GET_MODE_NUNITS (MODE)						\
   : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
 
 /* Moves between fp regs and other regs are two insns.  */
@@ -925,10 +927,19 @@
 
 #define PCC_STATIC_STRUCT_RETURN
 
-/* 1 if N is a possible register number for function argument passing.
-   On the 68000, no registers are used in this way.  */
+/* 1 if N is a possible register number for function argument passing.  */
 
-#define FUNCTION_ARG_REGNO_P(N) 0
+#define FUNCTION_ARG_REGNO_P(N)			\
+  (((N) >= 0 && (N) < M68K_MAX_REGPARM)		\
+   || ((N) >= 8 && (N) < 8 + M68K_MAX_REGPARM)	\
+   || (TARGET_68881 && (N) >= 16 && (N) < 16 + M68K_MAX_REGPARM))
+
+/* Nonzero if we need to generate special stack-allocating insns.
+   On most systems they are not needed.
+   When they are needed, also define ALTERNATE_ALLOCATE_STACK (see m68k.md)
+   to perform the necessary actions.  */
+
+#define TARGET_ALTERNATE_ALLOCATE_STACK 0
 
 /* Define a data type for recording info about an argument list
    during the scan of that argument list.  This data type should
@@ -936,28 +947,52 @@
    and about the args processed so far, enough to enable macros
    such as FUNCTION_ARG to determine where the next arg should go.
 
-   On the m68k, this is a single integer, which is a number of bytes
-   of arguments scanned so far.  */
+   On the m68k, this is a structure:
+   num_of_regs: number of data, address and float registers to use for
+     arguments passing (if it's 2, than pass arguments in d0, d1, a0, a1,
+     fp0 and fp1). 0 - pass everything on stack. vararg calls are
+     always passed entirely on stack.
+   regs_already_used: bitmask of the already used registers.
+   last_arg_reg - register number of the most recently passed argument.
+     -1 if passed on stack.
+   last_arg_len - number of registers used by the most recently passed
+     argument.
+*/
+
+struct m68k_args
+{
+  int num_of_regs;
+  long regs_already_used;
+  int last_arg_reg;
+  int last_arg_len;
+};
+
+#define CUMULATIVE_ARGS struct m68k_args
+
+/* Max. number of data, address and float registers to be used for passing
+   integer, pointer and float arguments when TARGET_REGPARM.
+   It's 4, so d0-d3, a0-a3 and fp0-fp3 can be used.  */
+
+#define M68K_MAX_REGPARM 4
 
-#define CUMULATIVE_ARGS int
+/* The default number of data, address and float registers to use when
+   user specified '-mregparm' switch, not '-mregparm=<value>' option.  */
+
+#define M68K_DEFAULT_REGPARM 2
 
 /* Initialize a variable CUM of type CUMULATIVE_ARGS
    for a call to a function whose data type is FNTYPE.
-   For a library call, FNTYPE is 0.
-
-   On the m68k, the offset starts at 0.  */
+   For a library call, FNTYPE is 0.  */
 
 #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT)	\
- ((CUM) = 0)
+  (m68k_init_cumulative_args (&(CUM), (FNTYPE)))
 
 /* Update the data in CUM to advance over an argument
    of mode MODE and data type TYPE.
    (TYPE is null for libcalls where that information may not be available.)  */
 
 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)	\
- ((CUM) += ((MODE) != BLKmode			\
-	    ? (GET_MODE_SIZE (MODE) + 3) & ~3	\
-	    : (int_size_in_bytes (TYPE) + 3) & ~3))
+  (m68k_function_arg_advance (&(CUM)))
 
 /* Define where to put the arguments to a function.
    Value is zero to push the argument on the stack,
@@ -972,24 +1007,21 @@
    NAMED is nonzero if this argument is a named parameter
     (otherwise it is an extra parameter matching an ellipsis).  */
 
-/* On the 68000 all args are pushed, except if -mregparm is specified
-   then the first two words of arguments are passed in d0, d1.
-   *NOTE* -mregparm does not work.
-   It exists only to test register calling conventions.  */
+/* On the 68000 all args are pushed, except if -mregparm is specified,
+   then a number of arguments is passed in the first 'm68k_regparm' data,
+   address and float registers.
+   Note: by default, the static-chain is passed in a0. Targets that want
+   to make full use of '-mregparm' are advised to pass the static-chain
+   somewhere else.  */
 
 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
-((TARGET_REGPARM && (CUM) < 8) ? gen_rtx_REG ((MODE), (CUM) / 4) : 0)
+  ((struct rtx_def *)m68k_function_arg (&(CUM), (MODE), (TYPE)))
 
 /* For an arg passed partly in registers and partly in memory,
    this is the number of registers used.
    For args passed entirely in registers or entirely in memory, zero.  */
 
-#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
-((TARGET_REGPARM && (CUM) < 8					\
-  && 8 < ((CUM) + ((MODE) == BLKmode				\
-		      ? int_size_in_bytes (TYPE)		\
-		      : GET_MODE_SIZE (MODE))))  		\
- ? 2 - (CUM) / 4 : 0)
+#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) (0)
 
 /* Generate the assembly code for function entry. */
 #define FUNCTION_PROLOGUE(FILE, SIZE) output_function_prologue(FILE, SIZE)
@@ -1190,6 +1222,8 @@
    of a local variable as a function of frame_pointer_needed, which
    is hard.  */
 
+#define SUBTARGET_INITIAL_FP_OFFSET(OFFSET)
+
 #define INITIAL_FRAME_POINTER_OFFSET(DEPTH)			\
 { int regno;							\
   int offset = -4;						\
@@ -1199,8 +1233,9 @@
   for (regno = 0; regno < 16; regno++)				\
     if (regs_ever_live[regno] && ! call_used_regs[regno])	\
       offset += 4;						\
-  if (flag_pic && current_function_uses_pic_offset_table)	\
+  if (flag_pic && flag_pic <= 2 && current_function_uses_pic_offset_table)	\
     offset += 4;						\
+  SUBTARGET_INITIAL_FP_OFFSET (offset);				\
   (DEPTH) = (offset + ((get_frame_size () + 3) & -4)		\
 	     + (get_frame_size () == 0 ? 0 : 4));		\
 }
@@ -2083,6 +2118,23 @@
 
 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR)
 
+
+/* Attributes support.  */
+
+/* A C expression whose value is nonzero if IDENTIFIER with arguments
+   ARGS is a valid machine specific attribute for TYPE.  The attributes
+   in ATTRIBUTES have previously been assigned to TYPE.  */
+
+#define VALID_MACHINE_TYPE_ATTRIBUTE(TYPE, ATTRIBUTES, IDENTIFIER, ARGS) \
+  (valid_m68k_type_attribute ((TYPE), (ATTRIBUTES), (IDENTIFIER), (ARGS)))
+
+/* A C expression whose value is zero if the attributes on TYPE1 and
+   TYPE2 are incompatible, one if they are compatible, and two if they
+   are nearly compatible (which causes a warning to be generated).  */
+
+#define COMP_TYPE_ATTRIBUTES(TYPE1, TYPE2) \
+  (comp_m68k_type_attributes ((TYPE1), (TYPE2)))
+
 /* Define functions defined in aux-output.c and used in templates.  */
 
 extern char *output_move_const_into_data_reg ();
@@ -2115,9 +2167,11 @@
 extern const char *m68k_align_loops_string;
 extern const char *m68k_align_jumps_string;
 extern const char *m68k_align_funcs_string;
+extern const char *m68k_regparm_string;
 extern int m68k_align_loops;
 extern int m68k_align_jumps;
 extern int m68k_align_funcs;
+extern int m68k_regparm;
 extern int m68k_last_compare_had_fp_operands;
 
 /* Functions from m68k.c used in macros.  */
diff -urNEBb gcc-2.95.3-orig/gcc/config/m68k/m68k.md gcc-2.95.3/gcc/config/m68k/m68k.md
--- gcc-2.95.3-orig/gcc/config/m68k/m68k.md	1999-08-05 08:22:05.000000000 +0200
+++ gcc-2.95.3/gcc/config/m68k/m68k.md	2003-12-02 17:50:55.000000000 +0100
@@ -6799,7 +6799,7 @@
 	 (match_operand:SI 1 "general_operand" "g"))]
   ;; Operand 1 not really used on the m68000.
 
-  "! flag_pic"
+  "(! flag_pic || flag_pic >= 3)"
   "*
 #if defined (MOTOROLA) && !defined (USE_GAS)
 #ifdef MOTOROLA_BSR
@@ -6819,7 +6819,7 @@
 	 (match_operand:SI 1 "general_operand" "g"))]
   ;; Operand 1 not really used on the m68000.
 
-  "flag_pic"
+  "(flag_pic && flag_pic < 3)"
   "*
   if (GET_CODE (operands[0]) == MEM
       && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
@@ -6862,7 +6862,7 @@
 	(call (match_operand:QI 1 "memory_operand" "o")
 	      (match_operand:SI 2 "general_operand" "g")))]
   ;; Operand 2 not really used on the m68000.
-  "! flag_pic"
+  "(! flag_pic || flag_pic >= 3)"
   "*
 #if defined (MOTOROLA) && !defined (USE_GAS)
 #ifdef MOTOROLA_BSR
@@ -6882,7 +6882,7 @@
 	(call (match_operand:QI 1 "memory_operand" "o")
 	      (match_operand:SI 2 "general_operand" "g")))]
   ;; Operand 2 not really used on the m68000.
-  "flag_pic"
+  "(flag_pic && flag_pic < 3)"
   "*
   if (GET_CODE (operands[1]) == MEM
       && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
diff -urNEBb gcc-2.95.3-orig/gcc/config/m68k/t-amigaos gcc-2.95.3/gcc/config/m68k/t-amigaos
--- gcc-2.95.3-orig/gcc/config/m68k/t-amigaos	1970-01-01 01:00:00.000000000 +0100
+++ gcc-2.95.3/gcc/config/m68k/t-amigaos	2003-12-02 17:50:55.000000000 +0100
@@ -0,0 +1,90 @@
+# Makefile fragment for AmigaOS target.
+
+# Each compilation environment (Manx, Dice, GCC, SAS/C, etc) provides its
+# own equivalent of the UNIX /usr/include tree.  For gcc, the standard headers
+# are in /gg/include and system specific headers are in /gg/os-include.
+# Use these paths for fixincludes.
+
+SYSTEM_HEADER_DIR = /gcc/include
+
+# Extra object file linked to the cc1* executables.
+amigaos.o: $(srcdir)/config/m68k/amigaos.c $(CONFIG_H)
+	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
+
+# We don't need a libgcc1, it's all in ixemul.library and LibNIX
+
+LIBGCC1 = libgcc1.null
+CROSS_LIBGCC1 = libgcc1.null
+
+# Additional target dependent options for compiling libgcc.a.  This just
+# ensures that we don't compile libgcc* with anything other than a
+# fixed stack.
+
+TARGET_LIBGCC2_CFLAGS = -mfixedstack
+
+# Support for building multiple version of libgcc.
+# Note: this is taken from the toplevel Makefile.in multilib support.
+LIBGCC = stmp-libgcc-multi
+INSTALL_LIBGCC = install-libgcc-multi
+
+LIBGCC_MULTI =	".;" \
+		"libb;@resident" \
+		"libm020;@m68020" \
+		"libb/libm020;@resident@m68020" \
+		"libb32/libm020;@resident32@m68020"
+
+# Build multiple copies of libgcc.a, one for each target switch.
+stmp-libgcc-multi: $(LIBGCC1) libgcc2.c libgcc2.ready $(CONFIG_H) \
+   frame.h \
+   $(LIB2ADD) machmode.h longlong.h gbl-ctors.h config.status
+	# We need the following explicit mkdir, since the toplevel
+	# Makefile.in attempts to create only the last directory
+	# of a path.
+	if [ -d libb32 ]; then true; else mkdir libb32; fi
+	for i in $(LIBGCC_MULTI); do \
+	  dir=`echo $$i | sed -e 's/;.*$$//'`; \
+	  flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
+	  $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
+	    AR_FOR_TARGET="$(AR_FOR_TARGET)" \
+	    AR_FLAGS_FOR_TARGET="$(AR_FLAGS_FOR_TARGET)" \
+	    CC="$(CC)" CFLAGS="$(CFLAGS)" \
+	    RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)" \
+	    RANLIB_TEST_FOR_TARGET="$(RANLIB_TEST_FOR_TARGET)" \
+	    LANGUAGES="$(LANGUAGES)" \
+	    HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \
+	    LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS) $${flags}" \
+	    MULTILIB_CFLAGS="$${flags}" \
+	    LIBGCC1="$(LIBGCC1)" LIBGCC2="$(LIBGCC2)" \
+	    dir="$${dir}" stmp-multilib-sub; \
+	  if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
+	done
+	touch stmp-libgcc-multi
+
+# Install multiple versions of libgcc.a.
+install-libgcc-multi: stmp-libgcc-multi installdirs
+	# We need the following explicit mkdir, since below we attempt to
+	# create only the last directory of a path.
+	if [ -d $(libsubdir)/libb32 ]; then true; else mkdir $(libsubdir)/libb32; fi
+	for i in $(LIBGCC_MULTI); do \
+	  dir=`echo $$i | sed -e 's/;.*$$//'`; \
+	  if [ -d $(libsubdir)/$${dir} ]; then true; else mkdir $(libsubdir)/$${dir}; fi; \
+	  for f in libgcc.a $(EXTRA_MULTILIB_PARTS); do \
+	    rm -f $(libsubdir)/$${dir}/$${f}; \
+	    $(INSTALL_DATA) $${dir}/$${f} $(libsubdir)/$${dir}/$${f}; \
+	  done; \
+	  if $(RANLIB_TEST_FOR_TARGET); then \
+	    (cd $(libsubdir)/$${dir}; $(RANLIB_FOR_TARGET) libgcc.a); \
+	  else true; fi; \
+	  chmod a-x $(libsubdir)/$${dir}/libgcc.a; \
+	done
+
+### begin-GG-local: dynamic libraries
+# Extra objects that get compiled and linked to collect2
+
+EXTRA_COLLECT2_OBJS = amigacollect2.o
+
+# Build supplimentary AmigaOS target support file for collect2
+amigacollect2.o: amigacollect2.c
+	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
+	-DA2IXDIR_PREFIX=\"$(prefix)/share/a2ixlibrary\" $(srcdir)/amigacollect2.c
+### end-GG-local
diff -urNEBb gcc-2.95.3-orig/gcc/config/m68k/x-amigaos gcc-2.95.3/gcc/config/m68k/x-amigaos
--- gcc-2.95.3-orig/gcc/config/m68k/x-amigaos	1970-01-01 01:00:00.000000000 +0100
+++ gcc-2.95.3/gcc/config/m68k/x-amigaos	2003-12-02 17:50:55.000000000 +0100
@@ -0,0 +1,77 @@
+# Makefile fragment for AmigaOS host
+
+# Uncomment the following macro to get a resident GCC. We don't do it
+# by default, since we want to support users with mc68000.
+# WARNING!  If you uncomment this, you MUST add the same flags to the
+# libiberty's Makefile (libiberty is now linked into GCC executables).
+
+#RESIDENT = -m68020 -resident32
+
+# Additional host flags that are not used when compiling with GCC_FOR_TARGET,
+# such as when compiling the libgcc* runtime archives. GCC uses stack
+# a lot, and since AmigaOS provides processes with a small, fixed size
+# stack, we have to generate code that will extend it whenever necessary.
+
+XCFLAGS = -mstackextend $(RESIDENT)
+
+# AmigaOS supports "AmigaGuide(R)" hypertext files. For GCC, these are
+# build with a custom "makeinfo".
+
+### begin-GG-local: gcc-amigaos
+EXTRA_DOC_TARGETS = guide gcc-amigaos-doc
+### end-GG-local
+
+# Arrange for guides to be build with GCC, in the build directory.
+
+ALL = all.internal doc
+
+# Actually build guides
+
+guide: cpp.guide gcc.guide
+
+cpp.guide: cpp.texi
+	$(MAKEINFO) -I$(srcdir) $(srcdir)/cpp.texi --output=$@ --amiga
+
+gcc.guide: gcc.texi extend.texi install.texi invoke.texi \
+		md.texi rtl.texi tm.texi
+	$(MAKEINFO) -I$(srcdir) $(srcdir)/gcc.texi --output=$@ --amiga
+
+# Arrange for guides to be installed with GCC.
+
+### begin-GG-local: gcc-amigaos
+INSTALL_TARGET=install-normal install-guide install-gcc-amigaos-doc
+### end-GG-local
+
+# Where the guide files go
+
+guidedir = $(prefix)/guide
+
+# Actually install guides.
+
+install-guide: doc installdirs
+	-if [ -d $(guidedir) ] ; then true ; else mkdir $(guidedir) ; chmod a+rx $(guidedir) ; fi
+	-rm -f $(guidedir)/cpp.guide $(guidedir)/gcc.guide
+	for f in cpp.guide gcc.guide; \
+	do $(INSTALL_DATA) $$f $(guidedir)/$$f; done
+	-chmod a-x $(guidedir)/cpp.guide $(guidedir)/gcc.guide
+
+### begin-GG-local: gcc-amigaos
+# Build and install gcc-amigaos.guide - documentation specific to the
+# AmigaOS port of GCC.
+
+gcc-amigaos-doc: gcc-amigaos.info gcc-amigaos.guide
+
+gcc-amigaos.info: gcc-amigaos.texi
+	$(MAKEINFO) -I$(srcdir) $(srcdir)/gcc-amigaos.texi --output=$@
+
+gcc-amigaos.guide: gcc-amigaos.texi
+	$(MAKEINFO) -I$(srcdir) $(srcdir)/gcc-amigaos.texi --output=$@ --amiga
+
+install-gcc-amigaos-doc: doc installdirs
+	-if [ -d $(guidedir) ] ; then true ; else mkdir $(guidedir) ; chmod a+rx $(guidedir) ; fi
+	-rm -f $(infodir)/gcc-amigaos.info* $(guidedir)/gcc-amigaos.guide
+	for f in gcc-amigaos.info*; \
+	do $(INSTALL_DATA) $$f $(infodir)/$$f; done
+	$(INSTALL_DATA) gcc-amigaos.guide $(guidedir)
+	-chmod a-x $(infodir)/gcc-amigaos.info* $(guidedir)/gcc-amigaos.guide
+### end-GG-local
diff -urNEBb gcc-2.95.3-orig/gcc/config/m68k/xm-amigaos.h gcc-2.95.3/gcc/config/m68k/xm-amigaos.h
--- gcc-2.95.3-orig/gcc/config/m68k/xm-amigaos.h	1970-01-01 01:00:00.000000000 +0100
+++ gcc-2.95.3/gcc/config/m68k/xm-amigaos.h	2003-12-02 17:50:55.000000000 +0100
@@ -0,0 +1,105 @@
+/* Configuration for GNU C-compiler for m68k Amiga, running AmigaOS.
+   Copyright (C) 1992, 93-96, 1997 Free Software Foundation, Inc.
+   Contributed by Markus M. Wild (wild@amiga.physik.unizh.ch).
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING.  If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* First include the generic header, then modify some parts.  */
+
+#include "m68k/xm-m68k.h"
+
+#ifndef _FCNTL_H_
+#include <fcntl.h>
+#endif
+
+/* Define various things that the AmigaOS host has.  */
+
+#define HAVE_ATEXIT
+#define HAVE_RENAME
+
+/* AmigaOS specific headers, such as from the Native Developer Update kits,
+   go in SYSTEM_INCLUDE_DIR.  STANDARD_INCLUDE_DIR is the equivalent of
+   Unix "/usr/include".  All other include paths are set in Makefile.  */
+
+#define SYSTEM_INCLUDE_DIR	"/gcc/os-include"
+#define STANDARD_INCLUDE_DIR	"/gcc/include"
+
+#define STANDARD_EXEC_PREFIX_1 "/gcc/lib/gcc/"
+#define STANDARD_STARTFILE_PREFIX_1 "/gcc/lib/"
+#define STANDARD_STARTFILE_PREFIX_2 "/gcc/lib/"
+
+/* The AmigaOS stores file names with regard to upper/lower case, but actions
+   on existing files are case independent on the standard filesystems.
+
+   A good example of where this causes problems is the conflict between the C
+   include file <string.h> and the C++ include file <String.h>, where the C++
+   include file dir is searched first and thus causes includes of <string.h>
+   to include <String.h> instead.
+
+   In order to solve this problem we define the macro OPEN_CASE_SENSITIVE as
+   the name of the function that takes the same args as open() and does case
+   dependent opens.  */
+
+#define OPEN_CASE_SENSITIVE(NAME, FLAGS, MODE) open ((NAME), (FLAGS) | O_CASE, (MODE))
+
+/* On the AmigaOS, there are two pathname separators, '/' (DIR_SEPARATOR)
+   and ':' (VOL_SEPARATOR).  DIR_SEPARATOR defaults to the correct
+   character, so we don't have to explicitly set it.  */
+
+#define DIR_SEPARATOR '/'
+#define VOL_SEPARATOR ':'
+
+/* Do *not* use this define, otherwise Amiga-devicenames ('DEV:') won't 
+   work:  */
+// #define DIR_SEPARATOR_2 VOL_SEPARATOR
+
+
+/* Determine whether a '\0'-terminated file name is absolute or not.
+
+   This checks for both, '/' as the first character, since we're running under
+   ixemul.library which provides for this unix'ism, and for the usual 
+   logical-terminator, ':', somewhere in the filename.  */
+
+#define FILE_NAME_ABSOLUTE_P(NAME) ((NAME)[0] == '/' || index ((NAME), ':'))
+
+/* Like the above, but the file name is not '\0'-terminated.  */
+
+#define FILE_NAME_ABSOLUTE_N_P(NAME, LEN) amigaos_file_name_absolute_n ((NAME), (LEN))
+
+/* Return the file name part of the path name.  */
+
+#define FILE_NAME_NONDIRECTORY(NAME)					\
+  (rindex ((NAME), '/') ? rindex ((NAME), '/') + 1			\
+			: (rindex ((NAME), ':') ? rindex ((NAME), ':') + 1 \
+						: (NAME)))
+
+/* Generate the name of the cross reference file.  */
+
+#define XREF_FILE_NAME(BUFF, NAME)					\
+do									\
+  {									\
+    char *filesrc, *filedst;						\
+    strcpy ((BUFF), (NAME));						\
+    filesrc = FILE_NAME_NONDIRECTORY (NAME);				\
+    filedst = (BUFF) + (filesrc - (NAME));				\
+    sprintf (filedst, ".%s.gxref", filesrc);				\
+  }									\
+while (0)
+
+/* olsen: we don't want to link with libgcc by default */
+#define LIBGCC_SPEC ""
diff -urNEBb gcc-2.95.3-orig/gcc/config/rs6000/amigaos.c gcc-2.95.3/gcc/config/rs6000/amigaos.c
--- gcc-2.95.3-orig/gcc/config/rs6000/amigaos.c	1970-01-01 01:00:00.000000000 +0100
+++ gcc-2.95.3/gcc/config/rs6000/amigaos.c	2003-12-02 17:50:55.000000000 +0100
@@ -0,0 +1,269 @@
+/* Subroutines used for code generation on Amiga OS 4
+   Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+   Free Software Foundation, Inc.
+   Contributed by Thomas Frieden (ThomasF@hyperion-entertainment.com)
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING.  If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#include "config.h"
+#include "system.h"
+#include "rtl.h"
+#include "regs.h"
+#include "hard-reg-set.h"
+#include "real.h"
+#include "insn-config.h"
+#include "conditions.h"
+#include "insn-flags.h"
+#include "insn-attr.h"
+#include "flags.h"
+#include "recog.h"
+#include "expr.h"
+#include "obstack.h"
+#include "tree.h"
+#include "except.h"
+#include "function.h"
+#include "output.h"
+#include "toplev.h"
+
+#undef DEBUG
+#ifdef DEBUG
+#define dprintf(FORMAT, ARG...)      		\
+printf("%s: ", __PRETTY_FUNCTION__);		\
+printf(FORMAT , ## ARG)
+#else
+#define dprintf(FORMAT, ARG...)
+#endif
+
+
+void
+amigaos_init_cumulative_args (cum, fntype, libname, incoming)
+     CUMULATIVE_ARGS *cum;
+     tree fntype;
+     rtx libname ATTRIBUTE_UNUSED;
+     int incoming;
+{
+    dprintf("enter\n");
+    init_cumulative_args(cum, fntype, libname, incoming);
+
+    /* Check if either libcall or linear varargs, set appropriate cookie */
+    if (fntype && (lookup_attribute("libcall", TYPE_ATTRIBUTES (fntype))))
+		cum->call_cookie |= CALL_LINEARVARARGS;
+
+    if (fntype && (lookup_attribute("linearvarargs", TYPE_ATTRIBUTES (fntype))))
+		cum->call_cookie |= CALL_LINEARVARARGS;
+
+    dprintf("exit\n");
+}
+
+
+void
+amigaos_function_arg_advance (cum, mode, type, named)
+     CUMULATIVE_ARGS *cum;
+     enum machine_mode mode;
+     tree type;
+     int named;
+{
+    dprintf("enter\n");
+    function_arg_advance(cum, mode, type, named);
+ 
+    if (cum->call_cookie & CALL_LINEARVARARGS && cum->sysv_gregno + cum->fregno - GP_ARG_MIN_REG - FP_ARG_MIN_REG > cum->orig_nargs)
+    {
+	cum->sysv_gregno = GP_ARG_MAX_REG + 1;
+	cum->fregno = FP_ARG_V4_MAX_REG + 1;
+    }
+    dprintf("exit\n");
+}
+
+
+struct rtx_def *
+amigaos_function_arg (cum, mode, type, named)
+     CUMULATIVE_ARGS *cum;
+     enum machine_mode mode;
+     tree type;
+     int named;
+{
+    struct rtx_def *res = 0;
+
+    dprintf("enter\n");
+    if (mode == VOIDmode && cum->call_cookie & CALL_LINEARVARARGS)
+	res = GEN_INT (cum->call_cookie);
+    else
+	res =  function_arg (cum, mode, type, named);
+
+    dprintf("exit\n");
+
+    return res;
+}
+
+
+
+void
+amigaos_setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl)
+     CUMULATIVE_ARGS *cum;
+     enum machine_mode mode;
+     tree type;
+     int *pretend_size;
+     int no_rtl;
+
+{
+  CUMULATIVE_ARGS next_cum;
+  int reg_size = TARGET_32BIT ? 4 : 8;
+  rtx save_area;
+  int first_reg_offset;
+
+  dprintf("enter\n");
+  if (cum->call_cookie & CALL_LINEARVARARGS)
+  {
+      tree fntype;
+      int stdarg_p;
+      
+      fntype = TREE_TYPE (current_function_decl);
+      stdarg_p = (TYPE_ARG_TYPES (fntype) != 0
+		  && (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype)))
+		      != void_type_node));
+      
+      /* For varargs, we do not want to skip the dummy va_dcl argument.
+	 For stdargs, we do want to skip the last named argument.  */
+      next_cum = *cum;
+      if (stdarg_p)
+	  function_arg_advance (&next_cum, mode, type, 1);
+      
+      /* Indicate to allocate space on the stack for varargs save area.  */
+      /* ??? Does this really have to be located at a magic spot on the
+	 stack, or can we allocate this with assign_stack_local instead.  */
+      rs6000_sysv_varargs_p = 1;
+      if (! no_rtl)
+	  save_area = plus_constant (virtual_stack_vars_rtx,
+				     - RS6000_VARARGS_SIZE);
+
+      first_reg_offset = next_cum.sysv_gregno - GP_ARG_MIN_REG;
+
+  }
+  else
+  {
+      setup_incoming_varargs(cum, mode, type, pretend_size, no_rtl);
+  }
+
+  dprintf("exit\n");
+
+}
+
+
+struct rtx_def *
+amigaos_expand_builtin_saveregs (args)
+     tree args ATTRIBUTE_UNUSED;
+{
+  rtx block, mem_gpr_fpr, mem_reg_save_area, mem_overflow, tmp;
+  tree fntype;
+  int stdarg_p;
+  HOST_WIDE_INT words, gpr, fpr;
+  struct rtx_def *res;
+
+  dprintf("enter\n");
+
+  if (current_function_args_info.call_cookie & CALL_LINEARVARARGS)
+  {
+      HOST_WIDE_INT bits;
+
+      fntype = TREE_TYPE (current_function_decl);
+      stdarg_p = (TYPE_ARG_TYPES (fntype) != 0
+		  && (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype)))
+		      != void_type_node));
+      
+      /* Allocate the va_list constructor.  */
+      block = assign_stack_local (BLKmode, 3 * UNITS_PER_WORD, BITS_PER_WORD);
+      RTX_UNCHANGING_P (block) = 1;
+      RTX_UNCHANGING_P (XEXP (block, 0)) = 1;
+      
+      mem_gpr_fpr = change_address (block, word_mode, XEXP (block, 0));
+      mem_overflow = change_address (block, ptr_mode,
+				     plus_constant (XEXP (block, 0),
+                                                UNITS_PER_WORD));
+      /*mem_reg_save_area = change_address (block, ptr_mode,
+	plus_constant (XEXP (block, 0),
+	2 * UNITS_PER_WORD));*/
+      
+      /* Construct the two characters of `gpr' and `fpr' as a unit.  */
+      words = current_function_args_info.words;
+      gpr = current_function_args_info.sysv_gregno - GP_ARG_MIN_REG;
+      
+      /* Varargs has the va_dcl argument, but we don't count it.  */
+      if (!stdarg_p)
+      {
+	  if (gpr > GP_ARG_NUM_REG)
+	      words -= 1;
+      }
+      
+      bits = (GP_ARG_MAX_REG - GP_ARG_MIN_REG + 1) << 8
+	  | (FP_ARG_MAX_REG - FP_ARG_MIN_REG + 1);
+      if (HOST_BITS_PER_WIDE_INT >= BITS_PER_WORD)
+	  tmp = GEN_INT (bits << (BITS_PER_WORD - 16));
+      else
+      {
+	  bits <<= BITS_PER_WORD - HOST_BITS_PER_WIDE_INT - 16;
+	  tmp = immed_double_const (0, bits, word_mode);
+      }
+      
+      emit_move_insn (mem_gpr_fpr, tmp);
+      
+      /* Find the overflow area.  */
+      tmp = expand_binop (Pmode, add_optab, virtual_incoming_args_rtx,
+			  GEN_INT (words * UNITS_PER_WORD),
+			  mem_overflow, 0, OPTAB_WIDEN);
+      if (tmp != mem_overflow)
+	  emit_move_insn (mem_overflow, tmp);
+      
+      /*tmp = expand_binop (Pmode, add_optab, virtual_stack_vars_rtx,
+	GEN_INT (-RS6000_VARARGS_SIZE),
+	mem_reg_save_area, 0, OPTAB_WIDEN);
+	if (tmp != mem_reg_save_area)
+	emit_move_insn (mem_reg_save_area, tmp);*/
+      
+      /* Return the address of the va_list constructor.  */
+      res = XEXP (block, 0);
+  }
+  else
+  {
+      res = expand_builtin_saveregs(args);
+  }
+
+  dprintf("exit\n");
+  return res;
+}
+
+
+int amigaos_valid_type_attribute_p (type, attributes, identifier, args)
+     tree type;
+     tree attributes ATTRIBUTE_UNUSED;
+     tree identifier;
+     tree args;
+{
+
+    if (TREE_CODE (type) != FUNCTION_TYPE
+	&& TREE_CODE (type) != FIELD_DECL
+	&& TREE_CODE (type) != TYPE_DECL)
+	return 0;
+
+    if (is_attribute_p ("libcall", identifier))
+	return (args == NULL_TREE);
+    
+    if (is_attribute_p ("linearvarargs", identifier))
+	return (args == NULL_TREE);
+
+    return rs6000_valid_type_attribute_p(type, attributes, identifier, args);
+}
diff -urNEBb gcc-2.95.3-orig/gcc/config/rs6000/amigaos.h gcc-2.95.3/gcc/config/rs6000/amigaos.h
--- gcc-2.95.3-orig/gcc/config/rs6000/amigaos.h	1970-01-01 01:00:00.000000000 +0100
+++ gcc-2.95.3/gcc/config/rs6000/amigaos.h	2003-12-31 17:12:22.000000000 +0100
@@ -0,0 +1,134 @@
+/* Definitions of target machine for GNU compiler, for AmigaOS.
+   Copyright (C) 1997 Free Software Foundation, Inc.
+
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING.  If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+
+#include "rs6000/sysv4.h"
+
+/* Don't assume anything about the header files. */
+#define NO_IMPLICIT_EXTERN_C
+
+#undef MD_EXEC_PREFIX
+#undef MD_STARTFILE_PREFIX
+
+/* Make CPU default to 604e. FIXME: Make this 750 later */
+#undef PROCESSOR_DEFAULT
+#define PROCESSOR_DEFAULT PROCESSOR_PPC604e
+
+#undef DEFAULT_ABI
+#define DEFAULT_ABI ABI_V4
+
+/* Make most of the definitions from other compilers available */
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES \
+ "-DPPC -D__ELF__ -Dpowerpc -Acpu(powerpc) -Amachine(powerpc) " \
+ "-DAMIGA -DAMIGAOS -DAMIGAOS4 -D__amigaos__ -D__amiga__ -D__amigaos4__ " \
+ "-Damiga -Damigaos -Damigaos4" 
+
+
+#ifdef __amigaos4__
+#undef CPP_OS_DEFAULT_SPEC
+#define CPP_OS_DEFAULT_SPEC "-I/gcc/local/include -I/gcc/os-include"
+#else
+#undef CPP_OS_DEFAULT_SPEC
+#define CPP_OS_DEFAULT_SPEC "-I/usr/local/amiga/ppc-amigaos/local/include -I/usr/local/amiga/ppc-amigaos/local/os-include"
+#endif
+
+#ifdef __amigaos4__
+#undef	LINK_OS_DEFAULT_SPEC
+#define	LINK_OS_DEFAULT_SPEC "-L/gcc/local/lib"
+#else
+#undef	LINK_OS_DEFAULT_SPEC
+#define	LINK_OS_DEFAULT_SPEC "-L/usr/local/amiga/ppc-amigaos/local/lib"
+#endif
+
+#undef LINK_SPEC
+#define LINK_SPEC "\
+--defsym __amigaos4__=1 \
+-q -n -d %{h*} %{v:-V} %{G*} \
+%{Wl,*:%*} %{YP,*} %{R*} \
+%{Qy:} %{!Qn:-Qy} \
+%(link_target) \
+%(link_os)"
+
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC 	"crtbegin.o%s %{pg:gcrt0.o%s} %{!pg:crt0.o%s} mainnb.o%s"
+
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC "crtend.o%s"
+
+#undef LIB_SPEC
+#define LIB_SPEC								\
+"%{!unix: --start-group -lc -lamiga --end-group } "				\
+"%{unix: --start-group -lunix -lc -lamiga -lunix --end-group } "		\
+"%{auto: -lauto} " \
+"%{profile:-lc_p}%{!profile:-lc} "
+
+#undef TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (PowerPC AmigaOS 4)");
+
+
+#undef DEFAULT_VTABLE_THUNKS
+#ifndef USE_GNULIBC_1
+#define DEFAULT_VTABLE_THUNKS 1
+#endif
+
+#undef JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 0
+
+/* Used as cookie for linear vararg passing */
+#define CALL_LINEARVARARGS      0x10000000
+
+/* Prototypes */
+void amigaos_init_cumulative_args();
+void amigaos_function_arg_advance();
+struct rtx_def *amigaos_function_arg();
+void amigaos_setup_incoming_varargs();
+struct rtx_def *amigaos_expand_builtin_saveregs();
+int amigaos_valid_type_attribute_p();
+
+/* Overrides */
+#undef INIT_CUMULATIVE_ARGS
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) \
+    amigaos_init_cumulative_args(&CUM, FNTYPE, LIBNAME, FALSE)
+
+#undef INIT_CUMULATIVE_INCOMING_ARGS
+#define INIT_CUMULATIVE_INCOMING_ARGS(CUM, FNTYPE, LIBNAME) \
+    amigaos_init_cumulative_args(&CUM, FNTYPE, LIBNAME, TRUE)
+
+#undef FUNCTION_ARG_ADVANCE
+#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)    \
+    amigaos_function_arg_advance(&CUM, MODE, TYPE, NAMED)
+
+#undef FUNCTION_ARG
+#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
+    amigaos_function_arg(&CUM, MODE, TYPE, NAMED)
+
+#undef SETUP_INCOMING_VARARGS
+#define SETUP_INCOMING_VARARGS(CUM,MODE, TYPE,PRETEND_SIZE, NO_RTL) \
+    amigaos_setup_incoming_varargs(&CUM, MODE, TYPE, &PRETEND_SIZE, NO_RTL)
+
+#undef EXPAND_BUILTIN_SAVEREGS
+#define EXPAND_BUILTIN_SAVEREGS(ARGS) \
+    amigaos_expand_builtin_saveregs(ARGS)
+
+#undef VALID_MACHINE_TYPE_ATTRIBUTE
+#define VALID_MACHINE_TYPE_ATTRIBUTE(TYPE, ATTRIBUTES, NAME, ARGS) \
+    amigaos_valid_type_attribute_p(TYPE, ATTRIBUTES, NAME, ARGS)
diff -urNEBb gcc-2.95.3-orig/gcc/config/rs6000/amigaos.h~ gcc-2.95.3/gcc/config/rs6000/amigaos.h~
--- gcc-2.95.3-orig/gcc/config/rs6000/amigaos.h~	1970-01-01 01:00:00.000000000 +0100
+++ gcc-2.95.3/gcc/config/rs6000/amigaos.h~	2003-12-06 18:31:20.000000000 +0100
@@ -0,0 +1,123 @@
+/* Definitions of target machine for GNU compiler, for AmigaOS.
+   Copyright (C) 1997 Free Software Foundation, Inc.
+
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING.  If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+
+#include "rs6000/sysv4.h"
+
+/* Don't assume anything about the header files. */
+#define NO_IMPLICIT_EXTERN_C
+
+#undef MD_EXEC_PREFIX
+#undef MD_STARTFILE_PREFIX
+
+/* Make CPU default to 604e. FIXME: Make this 750 later */
+#undef PROCESSOR_DEFAULT
+#define PROCESSOR_DEFAULT PROCESSOR_PPC604e
+
+#undef DEFAULT_ABI
+#define DEFAULT_ABI ABI_V4
+
+/* Make most of the definitions from other compilers available */
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES \
+ "-DPPC -D__ELF__ -Dpowerpc -Acpu(powerpc) -Amachine(powerpc) " \
+ "-DAMIGA -DAMIGAOS -DAMIGAOS4 -D__amigaos__ -D__amiga__ -D__amigaos4__ " \
+ "-Damiga -Damigaos -Damigaos4" 
+
+
+#undef CPP_OS_DEFAULT_SPEC
+#define CPP_OS_DEFAULT_SPEC "-I/gcc/local/include -I/gcc/os-include"
+
+#undef	LINK_OS_DEFAULT_SPEC
+#define	LINK_OS_DEFAULT_SPEC "-L/gcc/local/lib"
+
+#undef LINK_SPEC
+#define LINK_SPEC "\
+--defsym __amigaos4__=1 \
+-q -n -d %{h*} %{v:-V} %{G*} \
+%{Wl,*:%*} %{YP,*} %{R*} \
+%{Qy:} %{!Qn:-Qy} \
+%(link_target) \
+%(link_os)"
+
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC 	"crtbegin.o%s %{pg:gcrt0.o%s} %{!pg:crt0.o%s} mainnb.o%s"
+
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC "crtend.o%s"
+
+#undef LIB_SPEC
+#define LIB_SPEC								\
+"%{!unix: --start-group -lc -lamiga --end-group } "				\
+"%{unix: --start-group -lunix -lc -lamiga -lunix --end-group } "		\
+"%{profile:-lc_p}%{!profile:-lc} "
+
+#undef TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (PowerPC AmigaOS 4)");
+
+
+#undef DEFAULT_VTABLE_THUNKS
+#ifndef USE_GNULIBC_1
+#define DEFAULT_VTABLE_THUNKS 1
+#endif
+
+#undef JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 0
+
+/* Used as cookie for linear vararg passing */
+#define CALL_LINEARVARARGS      0x10000000
+
+/* Prototypes */
+void amigaos_init_cumulative_args();
+void amigaos_function_arg_advance();
+struct rtx_def *amigaos_function_arg();
+void amigaos_setup_incoming_varargs();
+struct rtx_def *amigaos_expand_builtin_saveregs();
+int amigaos_valid_type_attribute_p();
+
+/* Overrides */
+#undef INIT_CUMULATIVE_ARGS
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) \
+    amigaos_init_cumulative_args(&CUM, FNTYPE, LIBNAME, FALSE)
+
+#undef INIT_CUMULATIVE_INCOMING_ARGS
+#define INIT_CUMULATIVE_INCOMING_ARGS(CUM, FNTYPE, LIBNAME) \
+    amigaos_init_cumulative_args(&CUM, FNTYPE, LIBNAME, TRUE)
+
+#undef FUNCTION_ARG_ADVANCE
+#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)    \
+    amigaos_function_arg_advance(&CUM, MODE, TYPE, NAMED)
+
+#undef FUNCTION_ARG
+#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
+    amigaos_function_arg(&CUM, MODE, TYPE, NAMED)
+
+#undef SETUP_INCOMING_VARARGS
+#define SETUP_INCOMING_VARARGS(CUM,MODE, TYPE,PRETEND_SIZE, NO_RTL) \
+    amigaos_setup_incoming_varargs(&CUM, MODE, TYPE, &PRETEND_SIZE, NO_RTL)
+
+#undef EXPAND_BUILTIN_SAVEREGS
+#define EXPAND_BUILTIN_SAVEREGS(ARGS) \
+    amigaos_expand_builtin_saveregs(ARGS)
+
+#undef VALID_MACHINE_TYPE_ATTRIBUTE
+#define VALID_MACHINE_TYPE_ATTRIBUTE(TYPE, ATTRIBUTES, NAME, ARGS) \
+    amigaos_valid_type_attribute_p(TYPE, ATTRIBUTES, NAME, ARGS)
diff -urNEBb gcc-2.95.3-orig/gcc/config/rs6000/rs6000.md gcc-2.95.3/gcc/config/rs6000/rs6000.md
--- gcc-2.95.3-orig/gcc/config/rs6000/rs6000.md	2001-01-25 15:03:35.000000000 +0100
+++ gcc-2.95.3/gcc/config/rs6000/rs6000.md	2003-12-02 17:50:54.000000000 +0100
@@ -6615,7 +6615,7 @@
 }")
 
 (define_insn "*movdi_32"
-  [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,m,f,f,m,r,r,r,r,r")
+  [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,m,r,r,m,r,r,r,r,r")
 	(match_operand:DI 1 "input_operand" "r,m,r,f,m,f,IJK,n,G,H,F"))]
   "! TARGET_POWERPC64
    && (gpc_reg_operand (operands[0], DImode)
@@ -6627,6 +6627,7 @@
     default:
       abort ();
     case 0:
+	case 3:
       /* We normally copy the low-numbered register first.  However, if
 	 the first register operand 0 is the same as the second register of
 	 operand 1, we must copy in the opposite order.  */
@@ -6635,6 +6636,7 @@
       else
 	return \"mr %0,%1\;mr %L0,%L1\";
     case 1:
+	case 4:
       /* If the low-address word is used in the address, we must load it
 	 last.  Otherwise, load it first.  Note that we cannot have
 	 auto-increment in that case since the address register is known to be
@@ -6645,13 +6647,14 @@
       else
 	return \"{l%U1|lwz%U1} %0,%1\;{l|lwz} %L0,%L1\";
     case 2:
+	case 5:
       return \"{st%U0|stw%U0} %1,%0\;{st|stw} %L1,%L0\";
-    case 3:
+/*    case 3:
       return \"fmr %0,%1\";
     case 4:
       return \"lfd%U1%X1 %0,%1\";
     case 5:
-      return \"stfd%U0%X0 %1,%0\";
+      return \"stfd%U0%X0 %1,%0\";*/
     case 6:
     case 7:
     case 8:
diff -urNEBb gcc-2.95.3-orig/gcc/config/rs6000/rs6000.md.orig gcc-2.95.3/gcc/config/rs6000/rs6000.md.orig
--- gcc-2.95.3-orig/gcc/config/rs6000/rs6000.md.orig	1970-01-01 01:00:00.000000000 +0100
+++ gcc-2.95.3/gcc/config/rs6000/rs6000.md.orig	2003-12-02 17:50:54.000000000 +0100
@@ -0,0 +1,11008 @@
+;; Machine description for IBM RISC System 6000 (POWER) for GNU C compiler
+;; Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+;; 2000, 2001 Free Software Foundation, Inc.
+;; Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
+
+;; This file is part of GNU CC.
+
+;; GNU CC is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU CC is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU CC; see the file COPYING.  If not, write to
+;; the Free Software Foundation, 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;- See file "rtl.def" for documentation on define_insn, match_*, et. al.
+
+;; Define an insn type attribute.  This is used in function unit delay
+;; computations.
+(define_attr "type" "integer,load,store,fpload,fpstore,imul,idiv,branch,compare,delayed_compare,fpcompare,mtjmpr,fp,dmul,sdiv,ddiv,ssqrt,dsqrt,jmpreg"
+  (const_string "integer"))
+
+;; Length (in bytes).
+; '(pc)' in the following doesn't include the instruction itself; it is 
+; calculated as if the instruction had zero size.
+(define_attr "length" ""
+  (if_then_else (eq_attr "type" "branch")
+		(if_then_else (and (ge (minus (match_dup 0) (pc))
+				       (const_int -32768))
+				   (lt (minus (match_dup 0) (pc))
+				       (const_int 32764)))
+			      (const_int 8)
+			      (const_int 12))
+		(const_int 4)))
+
+;; Processor type -- this attribute must exactly match the processor_type
+;; enumeration in rs6000.h.
+
+(define_attr "cpu" "rios1,rios2,mpccore,ppc403,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc750"
+  (const (symbol_ref "rs6000_cpu_attr")))
+
+; (define_function_unit NAME MULTIPLICITY SIMULTANEITY
+;			TEST READY-DELAY ISSUE-DELAY [CONFLICT-LIST])
+
+; Load/Store Unit -- pure PowerPC only
+; (POWER and 601 use Integer Unit)
+(define_function_unit "lsu" 1 0
+  (and (eq_attr "type" "load")
+       (eq_attr "cpu" "mpccore,ppc603,ppc604,ppc604e,ppc620,ppc750"))
+  2 1)
+
+(define_function_unit "lsu" 1 0
+  (and (eq_attr "type" "store,fpstore")
+       (eq_attr "cpu" "mpccore,ppc603,ppc604,ppc604e,ppc620,ppc750"))
+  1 1)
+
+(define_function_unit "lsu" 1 0
+  (and (eq_attr "type" "fpload")
+       (eq_attr "cpu" "mpccore,ppc603,ppc750"))
+  2 1)
+
+(define_function_unit "lsu" 1 0
+  (and (eq_attr "type" "fpload")
+       (eq_attr "cpu" "ppc604,ppc604e,ppc620"))
+  3 1)
+
+(define_function_unit "iu" 1 0
+  (and (eq_attr "type" "load")
+       (eq_attr "cpu" "rios1,ppc403,ppc601"))
+  2 1)
+
+(define_function_unit "iu" 1 0
+  (and (eq_attr "type" "store,fpstore")
+       (eq_attr "cpu" "rios1,ppc403,ppc601"))
+  1 1)
+
+(define_function_unit "fpu" 1 0
+  (and (eq_attr "type" "fpstore")
+       (eq_attr "cpu" "rios1,ppc601"))
+  0 1)
+
+(define_function_unit "iu" 1 0
+  (and (eq_attr "type" "fpload")
+       (eq_attr "cpu" "rios1"))
+  2 1)
+
+(define_function_unit "iu" 1 0
+  (and (eq_attr "type" "fpload")
+       (eq_attr "cpu" "ppc601"))
+  3 1)
+
+(define_function_unit "iu2" 2 0
+  (and (eq_attr "type" "load,fpload")
+       (eq_attr "cpu" "rios2"))
+  2 1)
+
+(define_function_unit "iu2" 2 0
+  (and (eq_attr "type" "store,fpstore")
+       (eq_attr "cpu" "rios2"))
+  1 1)
+
+; Integer Unit (RIOS1, PPC601, PPC603)
+(define_function_unit "iu" 1 0
+  (and (eq_attr "type" "integer")
+       (eq_attr "cpu" "rios1,mpccore,ppc403,ppc601,ppc603"))
+  1 1)
+
+(define_function_unit "iu" 1 0
+  (and (eq_attr "type" "imul")
+       (eq_attr "cpu" "ppc403"))
+  4 4)
+
+(define_function_unit "iu" 1 0
+  (and (eq_attr "type" "imul")
+       (eq_attr "cpu" "rios1,ppc601,ppc603"))
+  5 5)
+
+(define_function_unit "iu" 1 0
+  (and (eq_attr "type" "idiv")
+       (eq_attr "cpu" "rios1"))
+  19 19)
+
+(define_function_unit "iu" 1 0
+  (and (eq_attr "type" "idiv")
+       (eq_attr "cpu" "ppc403"))
+  33 33)
+
+(define_function_unit "iu" 1 0
+  (and (eq_attr "type" "idiv")
+       (eq_attr "cpu" "ppc601"))
+  36 36)
+
+(define_function_unit "iu" 1 0
+  (and (eq_attr "type" "idiv")
+       (eq_attr "cpu" "ppc603"))
+  37 36)
+
+; RIOS2 has two integer units: a primary one which can perform all
+; operations and a secondary one which is fed in lock step with the first
+; and can perform "simple" integer operations.  
+; To catch this we define a 'dummy' imuldiv-unit that is also needed
+; for the complex insns. 
+(define_function_unit "iu2" 2 0
+  (and (eq_attr "type" "integer")
+       (eq_attr "cpu" "rios2"))
+  1 1)
+
+(define_function_unit "iu2" 2 0
+  (and (eq_attr "type" "imul")
+       (eq_attr "cpu" "rios2"))
+  2 2)
+
+(define_function_unit "iu2" 2 0
+  (and (eq_attr "type" "idiv")
+       (eq_attr "cpu" "rios2"))
+  13 13)
+
+(define_function_unit "imuldiv" 1 0
+  (and (eq_attr "type" "imul")
+       (eq_attr "cpu" "rios2"))
+  2 2)
+
+(define_function_unit "imuldiv" 1 0
+  (and (eq_attr "type" "idiv")
+       (eq_attr "cpu" "rios2"))
+  13 13)
+
+; MPCCORE has separate IMUL/IDIV unit for multicycle instructions
+; Divide latency varies greatly from 2-11, use 6 as average
+(define_function_unit "imuldiv" 1 0
+  (and (eq_attr "type" "imul")
+       (eq_attr "cpu" "mpccore"))
+  2 1)
+
+(define_function_unit "imuldiv" 1 0
+  (and (eq_attr "type" "idiv")
+       (eq_attr "cpu" "mpccore"))
+  6 6)
+
+; PPC604{,e} has two units that perform integer operations
+; and one unit for divide/multiply operations (and move
+; from/to spr).
+(define_function_unit "iu2" 2 0
+  (and (eq_attr "type" "integer")
+       (eq_attr "cpu" "ppc604,ppc604e,ppc620"))
+  1 1)
+
+(define_function_unit "imuldiv" 1 0
+  (and (eq_attr "type" "imul")
+       (eq_attr "cpu" "ppc604,ppc620"))
+  4 2)
+
+(define_function_unit "imuldiv" 1 0
+  (and (eq_attr "type" "imul")
+       (eq_attr "cpu" "ppc604e"))
+  2 1)
+
+(define_function_unit "imuldiv" 1 0
+  (and (eq_attr "type" "idiv")
+       (eq_attr "cpu" "ppc604,ppc604e,ppc620"))
+  20 19)
+
+; PPC750 has two integer units: a primary one which can perform all
+; operations and a secondary one which is fed in lock step with the first
+; and can perform "simple" integer operations.  
+; To catch this we define a 'dummy' imuldiv-unit that is also needed
+; for the complex insns. 
+(define_function_unit "iu2" 2 0
+  (and (eq_attr "type" "integer")
+       (eq_attr "cpu" "ppc750"))
+  1 1)
+
+(define_function_unit "iu2" 2 0
+  (and (eq_attr "type" "imul")
+       (eq_attr "cpu" "ppc750"))
+  4 2)
+
+(define_function_unit "imuldiv" 1 0
+  (and (eq_attr "type" "imul")
+       (eq_attr "cpu" "ppc750"))
+  4 2)
+
+(define_function_unit "imuldiv" 1 0
+  (and (eq_attr "type" "idiv")
+       (eq_attr "cpu" "ppc750"))
+  19 19)
+
+; compare is done on integer unit, but feeds insns which
+; execute on the branch unit.
+(define_function_unit "iu" 1 0   
+  (and (eq_attr "type" "compare")
+       (eq_attr "cpu" "rios1"))
+  4 1)
+
+(define_function_unit "iu" 1 0   
+  (and (eq_attr "type" "delayed_compare")
+       (eq_attr "cpu" "rios1"))
+  5 1)
+
+(define_function_unit "iu" 1 0
+  (and (eq_attr "type" "compare,delayed_compare")
+       (eq_attr "cpu" "mpccore,ppc403,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc750"))
+  3 1)
+
+(define_function_unit "iu2" 2 0   
+  (and (eq_attr "type" "compare,delayed_compare")
+       (eq_attr "cpu" "rios2"))
+  3 1)
+
+(define_function_unit "iu2" 2 0
+  (and (eq_attr "type" "compare,delayed_compare")
+       (eq_attr "cpu" "ppc604,ppc604e,ppc620,ppc750"))
+  1 1)
+
+; fp compare uses fp unit
+(define_function_unit "fpu" 1 0
+  (and (eq_attr "type" "fpcompare")
+       (eq_attr "cpu" "rios1"))
+  9 1)
+
+; rios1 and rios2 have different fpcompare delays
+(define_function_unit "fpu2" 2 0
+  (and (eq_attr "type" "fpcompare")
+       (eq_attr "cpu" "rios2"))
+  5 1)
+
+; on ppc601 and ppc603, fpcompare takes also 2 cycles from
+; the integer unit
+; here we do not define delays, just occupy the unit. The dependencies
+; will be assigned by the fpcompare definition in the fpu.
+(define_function_unit "iu" 1 0
+  (and (eq_attr "type" "fpcompare")
+       (eq_attr "cpu" "ppc601,ppc603"))
+  0 2)
+
+; fp compare uses fp unit
+(define_function_unit "fpu" 1 0
+  (and (eq_attr "type" "fpcompare")
+       (eq_attr "cpu" "ppc601,ppc603,ppc604,ppc604e,ppc620,ppc750"))
+  5 1)
+
+(define_function_unit "fpu" 1 0
+  (and (eq_attr "type" "fpcompare")
+       (eq_attr "cpu" "mpccore"))
+  1 1)
+
+(define_function_unit "bpu" 1 0
+  (and (eq_attr "type" "mtjmpr")
+       (eq_attr "cpu" "rios1,rios2"))
+  5 1)
+
+(define_function_unit "bpu" 1 0
+  (and (eq_attr "type" "mtjmpr")
+       (eq_attr "cpu" "mpccore,ppc403,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc750"))
+  4 1)
+
+; all jumps/branches are executing on the bpu, in 1 cycle, for all machines.
+(define_function_unit "bpu" 1 0
+  (eq_attr "type" "jmpreg")
+  1 1)
+
+(define_function_unit "bpu" 1 0
+  (eq_attr "type" "branch")
+  1 1)
+
+; Floating Point Unit
+(define_function_unit "fpu" 1 0
+  (and (eq_attr "type" "fp,dmul")
+       (eq_attr "cpu" "rios1"))
+  2 1)
+
+(define_function_unit "fpu" 1 0
+  (and (eq_attr "type" "fp")
+       (eq_attr "cpu" "mpccore"))
+  4 4)
+
+(define_function_unit "fpu" 1 0
+  (and (eq_attr "type" "fp")
+       (eq_attr "cpu" "ppc601"))
+  4 1)
+
+(define_function_unit "fpu" 1 0
+  (and (eq_attr "type" "fp")
+       (eq_attr "cpu" "ppc603,ppc604,ppc604e,ppc620,ppc750"))
+  3 1)
+
+(define_function_unit "fpu" 1 0
+  (and (eq_attr "type" "dmul")
+       (eq_attr "cpu" "mpccore"))
+  5 5)
+
+(define_function_unit "fpu" 1 0
+  (and (eq_attr "type" "dmul")
+       (eq_attr "cpu" "ppc601"))
+  5 2)
+
+; is this true?
+(define_function_unit "fpu" 1 0
+  (and (eq_attr "type" "dmul")
+       (eq_attr "cpu" "ppc603,ppc750"))
+  4 2)
+
+(define_function_unit "fpu" 1 0
+  (and (eq_attr "type" "dmul")
+       (eq_attr "cpu" "ppc604,ppc604e,ppc620"))
+  3 1)
+
+(define_function_unit "fpu" 1 0
+  (and (eq_attr "type" "sdiv,ddiv")
+       (eq_attr "cpu" "rios1"))
+  19 19)
+
+(define_function_unit "fpu" 1 0
+  (and (eq_attr "type" "sdiv")
+       (eq_attr "cpu" "ppc601"))
+  17 17)
+
+(define_function_unit "fpu" 1 0
+  (and (eq_attr "type" "sdiv")
+       (eq_attr "cpu" "mpccore"))
+  10 10)
+
+(define_function_unit "fpu" 1 0
+  (and (eq_attr "type" "sdiv")
+       (eq_attr "cpu" "ppc603,ppc604,ppc604e,ppc620"))
+  18 18)
+
+(define_function_unit "fpu" 1 0
+  (and (eq_attr "type" "ddiv")
+       (eq_attr "cpu" "mpccore"))
+  17 17)
+
+(define_function_unit "fpu" 1 0
+  (and (eq_attr "type" "ddiv")
+       (eq_attr "cpu" "ppc601,ppc604,ppc604e,ppc620,ppc750"))
+  31 31)
+
+(define_function_unit "fpu" 1 0
+  (and (eq_attr "type" "ddiv")
+       (eq_attr "cpu" "ppc603"))
+  33 33)
+
+(define_function_unit "fpu" 1 0
+  (and (eq_attr "type" "ssqrt")
+       (eq_attr "cpu" "ppc620"))
+  31 31)
+
+(define_function_unit "fpu" 1 0
+  (and (eq_attr "type" "dsqrt")
+       (eq_attr "cpu" "ppc620"))
+  31 31)
+
+; RIOS2 has two symmetric FPUs.
+(define_function_unit "fpu2" 2 0
+  (and (eq_attr "type" "fp")
+       (eq_attr "cpu" "rios2"))
+  2 1)
+
+(define_function_unit "fpu2" 2 0
+  (and (eq_attr "type" "dmul")
+       (eq_attr "cpu" "rios2"))
+  2 1)
+
+(define_function_unit "fpu2" 2 0
+  (and (eq_attr "type" "sdiv,ddiv")
+       (eq_attr "cpu" "rios2"))
+  17 17)
+
+(define_function_unit "fpu2" 2 0
+  (and (eq_attr "type" "ssqrt,dsqrt")
+       (eq_attr "cpu" "rios2"))
+  26 26)
+
+
+;; Start with fixed-point load and store insns.  Here we put only the more
+;; complex forms.  Basic data transfer is done later.
+
+(define_expand "zero_extendqidi2"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+	(zero_extend:DI (match_operand:QI 1 "gpc_reg_operand" "")))]
+  "TARGET_POWERPC64"
+  "")
+
+(define_insn ""
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
+	(zero_extend:DI (match_operand:QI 1 "reg_or_mem_operand" "m,r")))]
+  "TARGET_POWERPC64"
+  "@
+   lbz%U1%X1 %0,%1
+   rldicl %0,%1,0,56"
+  [(set_attr "type" "load,*")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (zero_extend:DI (match_operand:QI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (clobber (match_scratch:DI 2 "=r"))]
+  "TARGET_POWERPC64"
+  "rldicl. %2,%1,0,56"
+  [(set_attr "type" "compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 2 "cc_reg_operand" "=x")
+	(compare:CC (zero_extend:DI (match_operand:QI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(zero_extend:DI (match_dup 1)))]
+  "TARGET_POWERPC64"
+  "rldicl. %0,%1,0,56"
+  [(set_attr "type" "compare")])
+
+(define_insn "extendqidi2"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(sign_extend:DI (match_operand:QI 1 "gpc_reg_operand" "r")))]
+  "TARGET_POWERPC64"
+  "extsb %0,%1")
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (sign_extend:DI (match_operand:QI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (clobber (match_scratch:DI 2 "=r"))]
+  "TARGET_POWERPC64"
+  "extsb. %2,%1"
+  [(set_attr "type" "compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 2 "cc_reg_operand" "=x")
+	(compare:CC (sign_extend:DI (match_operand:QI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(sign_extend:DI (match_dup 1)))]
+  "TARGET_POWERPC64"
+  "extsb. %0,%1"
+  [(set_attr "type" "compare")])
+
+(define_expand "zero_extendhidi2"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+	(zero_extend:DI (match_operand:HI 1 "gpc_reg_operand" "")))]
+  "TARGET_POWERPC64"
+  "")
+
+(define_insn ""
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
+	(zero_extend:DI (match_operand:HI 1 "reg_or_mem_operand" "m,r")))]
+  "TARGET_POWERPC64"
+  "@
+   lhz%U1%X1 %0,%1
+   rldicl %0,%1,0,48"
+  [(set_attr "type" "load,*")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (zero_extend:DI (match_operand:HI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (clobber (match_scratch:DI 2 "=r"))]
+  "TARGET_POWERPC64"
+  "rldicl. %2,%1,0,48"
+  [(set_attr "type" "compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 2 "cc_reg_operand" "=x")
+	(compare:CC (zero_extend:DI (match_operand:HI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(zero_extend:DI (match_dup 1)))]
+  "TARGET_POWERPC64"
+  "rldicl. %0,%1,0,48"
+  [(set_attr "type" "compare")])
+
+(define_expand "extendhidi2"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+	(sign_extend:DI (match_operand:HI 1 "gpc_reg_operand" "")))]
+  "TARGET_POWERPC64"
+  "")
+
+(define_insn ""
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
+	(sign_extend:DI (match_operand:HI 1 "reg_or_mem_operand" "m,r")))]
+  "TARGET_POWERPC64"
+  "@
+   lha%U1%X1 %0,%1
+   extsh %0,%1"
+  [(set_attr "type" "load,*")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (sign_extend:DI (match_operand:HI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (clobber (match_scratch:DI 2 "=r"))]
+  "TARGET_POWERPC64"
+  "extsh. %2,%1"
+  [(set_attr "type" "compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 2 "cc_reg_operand" "=x")
+	(compare:CC (sign_extend:DI (match_operand:HI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(sign_extend:DI (match_dup 1)))]
+  "TARGET_POWERPC64"
+  "extsh. %0,%1"
+  [(set_attr "type" "compare")])
+
+(define_expand "zero_extendsidi2"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+	(zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "")))]
+  "TARGET_POWERPC64"
+  "")
+
+(define_insn ""
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
+	(zero_extend:DI (match_operand:SI 1 "reg_or_mem_operand" "m,r")))]
+  "TARGET_POWERPC64"
+  "@
+   lwz%U1%X1 %0,%1
+   rldicl %0,%1,0,32"
+  [(set_attr "type" "load,*")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (clobber (match_scratch:DI 2 "=r"))]
+  "TARGET_POWERPC64"
+  "rldicl. %2,%1,0,32"
+  [(set_attr "type" "compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 2 "cc_reg_operand" "=x")
+	(compare:CC (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(zero_extend:DI (match_dup 1)))]
+  "TARGET_POWERPC64"
+  "rldicl. %0,%1,0,32"
+  [(set_attr "type" "compare")])
+
+(define_expand "extendsidi2"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+	(sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" "")))]
+  "TARGET_POWERPC64"
+  "")
+
+(define_insn ""
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
+	(sign_extend:DI (match_operand:SI 1 "lwa_operand" "m,r")))]
+  "TARGET_POWERPC64"
+  "@
+   lwa%U1%X1 %0,%1
+   extsw %0,%1"
+  [(set_attr "type" "load,*")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (clobber (match_scratch:DI 2 "=r"))]
+  "TARGET_POWERPC64"
+  "extsw. %2,%1"
+  [(set_attr "type" "compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 2 "cc_reg_operand" "=x")
+	(compare:CC (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(sign_extend:DI (match_dup 1)))]
+  "TARGET_POWERPC64"
+  "extsw. %0,%1"
+  [(set_attr "type" "compare")])
+
+(define_expand "zero_extendqisi2"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "")
+	(zero_extend:SI (match_operand:QI 1 "gpc_reg_operand" "")))]
+  ""
+  "")
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(zero_extend:SI (match_operand:QI 1 "reg_or_mem_operand" "m,r")))]
+  ""
+  "@
+   lbz%U1%X1 %0,%1
+   {rlinm|rlwinm} %0,%1,0,0xff"
+  [(set_attr "type" "load,*")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (zero_extend:SI (match_operand:QI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 2 "=r"))]
+  ""
+  "{andil.|andi.} %2,%1,0xff"
+  [(set_attr "type" "compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 2 "cc_reg_operand" "=x")
+	(compare:CC (zero_extend:SI (match_operand:QI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(zero_extend:SI (match_dup 1)))]
+  ""
+  "{andil.|andi.} %0,%1,0xff"
+  [(set_attr "type" "compare")])
+
+(define_expand "extendqisi2"
+  [(use (match_operand:SI 0 "gpc_reg_operand" ""))
+   (use (match_operand:QI 1 "gpc_reg_operand" ""))]
+  ""
+  "
+{
+  if (TARGET_POWERPC)
+    emit_insn (gen_extendqisi2_ppc (operands[0], operands[1]));
+  else if (TARGET_POWER)
+    emit_insn (gen_extendqisi2_power (operands[0], operands[1]));
+  else
+    emit_insn (gen_extendqisi2_no_power (operands[0], operands[1]));
+  DONE;
+}")
+
+(define_insn "extendqisi2_ppc"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(sign_extend:SI (match_operand:QI 1 "gpc_reg_operand" "r")))]
+  "TARGET_POWERPC"
+  "extsb %0,%1")
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (sign_extend:SI (match_operand:QI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 2 "=r"))]
+  "TARGET_POWERPC"
+  "extsb. %2,%1"
+  [(set_attr "type" "compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 2 "cc_reg_operand" "=x")
+	(compare:CC (sign_extend:SI (match_operand:QI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(sign_extend:SI (match_dup 1)))]
+  "TARGET_POWERPC"
+  "extsb. %0,%1"
+  [(set_attr "type" "compare")])
+
+(define_expand "extendqisi2_power"
+  [(parallel [(set (match_dup 2)
+		   (ashift:SI (match_operand:QI 1 "gpc_reg_operand" "")
+			      (const_int 24)))
+	      (clobber (scratch:SI))])
+   (parallel [(set (match_operand:SI 0 "gpc_reg_operand" "")
+		   (ashiftrt:SI (match_dup 2)
+				(const_int 24)))
+	      (clobber (scratch:SI))])]
+  "TARGET_POWER"
+  "
+{ operands[1] = gen_lowpart (SImode, operands[1]);
+  operands[2] = gen_reg_rtx (SImode); }")
+
+(define_expand "extendqisi2_no_power"
+  [(set (match_dup 2)
+	(ashift:SI (match_operand:QI 1 "gpc_reg_operand" "")
+		   (const_int 24)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(ashiftrt:SI (match_dup 2)
+		     (const_int 24)))]
+  "! TARGET_POWER && ! TARGET_POWERPC"
+  "
+{ operands[1] = gen_lowpart (SImode, operands[1]);
+  operands[2] = gen_reg_rtx (SImode); }")
+
+(define_expand "zero_extendqihi2"
+  [(set (match_operand:HI 0 "gpc_reg_operand" "")
+	(zero_extend:HI (match_operand:QI 1 "gpc_reg_operand" "")))]
+  ""
+  "")
+
+(define_insn ""
+  [(set (match_operand:HI 0 "gpc_reg_operand" "=r,r")
+	(zero_extend:HI (match_operand:QI 1 "reg_or_mem_operand" "m,r")))]
+  ""
+  "@
+   lbz%U1%X1 %0,%1
+   {rlinm|rlwinm} %0,%1,0,0xff"
+  [(set_attr "type" "load,*")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (zero_extend:HI (match_operand:QI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (clobber (match_scratch:HI 2 "=r"))]
+  ""
+  "{andil.|andi.} %2,%1,0xff"
+  [(set_attr "type" "compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 2 "cc_reg_operand" "=x")
+	(compare:CC (zero_extend:HI (match_operand:QI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (set (match_operand:HI 0 "gpc_reg_operand" "=r")
+	(zero_extend:HI (match_dup 1)))]
+  ""
+  "{andil.|andi.} %0,%1,0xff"
+  [(set_attr "type" "compare")])
+
+(define_expand "extendqihi2"
+  [(use (match_operand:HI 0 "gpc_reg_operand" ""))
+   (use (match_operand:QI 1 "gpc_reg_operand" ""))]
+  ""
+  "
+{
+  if (TARGET_POWERPC)
+    emit_insn (gen_extendqihi2_ppc (operands[0], operands[1]));
+  else if (TARGET_POWER)
+    emit_insn (gen_extendqihi2_power (operands[0], operands[1]));
+  else
+    emit_insn (gen_extendqihi2_no_power (operands[0], operands[1]));
+  DONE;
+}")
+
+(define_insn "extendqihi2_ppc"
+  [(set (match_operand:HI 0 "gpc_reg_operand" "=r")
+	(sign_extend:HI (match_operand:QI 1 "gpc_reg_operand" "r")))]
+  "TARGET_POWERPC"
+  "extsb %0,%1")
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (sign_extend:HI (match_operand:QI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (clobber (match_scratch:HI 2 "=r"))]
+  "TARGET_POWERPC"
+  "extsb. %2,%1"
+  [(set_attr "type" "compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 2 "cc_reg_operand" "=x")
+	(compare:CC (sign_extend:HI (match_operand:QI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (set (match_operand:HI 0 "gpc_reg_operand" "=r")
+	(sign_extend:HI (match_dup 1)))]
+  "TARGET_POWERPC"
+  "extsb. %0,%1"
+  [(set_attr "type" "compare")])
+
+(define_expand "extendqihi2_power"
+  [(parallel [(set (match_dup 2)
+		   (ashift:SI (match_operand:QI 1 "gpc_reg_operand" "")
+			      (const_int 24)))
+	      (clobber (scratch:SI))])
+   (parallel [(set (match_operand:HI 0 "gpc_reg_operand" "")
+		   (ashiftrt:SI (match_dup 2)
+				(const_int 24)))
+	      (clobber (scratch:SI))])]
+  "TARGET_POWER"
+  "
+{ operands[0] = gen_lowpart (SImode, operands[0]);
+  operands[1] = gen_lowpart (SImode, operands[1]);
+  operands[2] = gen_reg_rtx (SImode); }")
+
+(define_expand "extendqihi2_no_power"
+  [(set (match_dup 2)
+	(ashift:SI (match_operand:QI 1 "gpc_reg_operand" "")
+		   (const_int 24)))
+   (set (match_operand:HI 0 "gpc_reg_operand" "")
+	(ashiftrt:SI (match_dup 2)
+		     (const_int 24)))]
+  "! TARGET_POWER && ! TARGET_POWERPC"
+  "
+{ operands[0] = gen_lowpart (SImode, operands[0]);
+  operands[1] = gen_lowpart (SImode, operands[1]);
+  operands[2] = gen_reg_rtx (SImode); }")
+
+(define_expand "zero_extendhisi2"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "")
+	(zero_extend:SI (match_operand:HI 1 "gpc_reg_operand" "")))]
+  ""
+  "")
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(zero_extend:SI (match_operand:HI 1 "reg_or_mem_operand" "m,r")))]
+  ""
+  "@
+   lhz%U1%X1 %0,%1
+   {rlinm|rlwinm} %0,%1,0,0xffff"
+  [(set_attr "type" "load,*")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (zero_extend:SI (match_operand:HI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 2 "=r"))]
+  ""
+  "{andil.|andi.} %2,%1,0xffff"
+  [(set_attr "type" "compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 2 "cc_reg_operand" "=x")
+	(compare:CC (zero_extend:SI (match_operand:HI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(zero_extend:SI (match_dup 1)))]
+  ""
+  "{andil.|andi.} %0,%1,0xffff"
+  [(set_attr "type" "compare")])
+
+(define_expand "extendhisi2"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "")
+	(sign_extend:SI (match_operand:HI 1 "gpc_reg_operand" "")))]
+  ""
+  "")
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(sign_extend:SI (match_operand:HI 1 "reg_or_mem_operand" "m,r")))]
+  ""
+  "@
+   lha%U1%X1 %0,%1
+   {exts|extsh} %0,%1"
+  [(set_attr "type" "load,*")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (sign_extend:SI (match_operand:HI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 2 "=r"))]
+  ""
+  "{exts.|extsh.} %2,%1"
+  [(set_attr "type" "compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 2 "cc_reg_operand" "=x")
+	(compare:CC (sign_extend:SI (match_operand:HI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(sign_extend:SI (match_dup 1)))]
+  ""
+  "{exts.|extsh.} %0,%1"
+  [(set_attr "type" "compare")])
+
+;; Fixed-point arithmetic insns.
+
+;; Discourage ai/addic because of carry but provide it in an alternative
+;; allowing register zero as source.
+(define_expand "addsi3"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "")
+	(plus:SI (match_operand:SI 1 "gpc_reg_operand" "")
+		 (match_operand:SI 2 "reg_or_cint_operand" "")))]
+  ""
+  "
+{
+  if (GET_CODE (operands[2]) == CONST_INT
+		&& ! add_operand (operands[2], SImode))
+    {
+      rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1]))
+		 ? operands[0] : gen_reg_rtx (SImode));
+
+      HOST_WIDE_INT low = INTVAL (operands[2]) & 0xffff;
+      HOST_WIDE_INT high = INTVAL (operands[2]) & (~ (HOST_WIDE_INT) 0xffff);
+
+      if (low & 0x8000)
+        high += 0x10000, low |= ((HOST_WIDE_INT) -1) << 16;
+
+      emit_insn (gen_addsi3 (tmp, operands[1], GEN_INT (high)));
+      emit_insn (gen_addsi3 (operands[0], tmp, GEN_INT (low)));
+      DONE;
+    }
+}")
+
+(define_insn "*addsi3_internal1"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,?r,r")
+	(plus:SI (match_operand:SI 1 "gpc_reg_operand" "%r,b,r,b")
+		 (match_operand:SI 2 "add_operand" "r,I,I,L")))]
+  ""
+  "@
+   {cax|add} %0,%1,%2
+   {cal %0,%2(%1)|addi %0,%1,%2}
+   {ai|addic} %0,%1,%2
+   {cau|addis} %0,%1,%v2"
+  [(set_attr "length" "4,4,4,4")])
+
+(define_insn "*addsi3_internal2"
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
+	(compare:CC (plus:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r")
+			     (match_operand:SI 2 "reg_or_short_operand" "r,I,r,I"))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 "=r,r,r,r"))]
+  "! TARGET_POWERPC64"
+  "@
+   {cax.|add.} %3,%1,%2
+   {ai.|addic.} %3,%1,%2
+   #
+   #"
+  [(set_attr "type" "compare")
+   (set_attr "length" "4,4,8,8")])
+
+(define_split
+  [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
+	(compare:CC (plus:SI (match_operand:SI 1 "gpc_reg_operand" "")
+			     (match_operand:SI 2 "reg_or_short_operand" ""))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 ""))]
+  "! TARGET_POWERPC64 && reload_completed"
+  [(set (match_dup 3)
+	(plus:SI (match_dup 1)
+		 (match_dup 2)))
+   (set (match_dup 0)
+	(compare:CC (match_dup 3)
+		    (const_int 0)))]
+  "")
+
+(define_insn "*addsi3_internal3"
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y")
+	(compare:CC (plus:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r")
+			     (match_operand:SI 2 "reg_or_short_operand" "r,I,r,I"))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
+	(plus:SI (match_dup 1)
+		 (match_dup 2)))]
+  "! TARGET_POWERPC64"
+  "@
+   {cax.|add.} %0,%1,%2
+   {ai.|addic.} %0,%1,%2
+   #
+   #"
+  [(set_attr "type" "compare")
+   (set_attr "length" "4,4,8,8")])
+
+(define_split
+  [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
+	(compare:CC (plus:SI (match_operand:SI 1 "gpc_reg_operand" "")
+			     (match_operand:SI 2 "reg_or_short_operand" ""))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(plus:SI (match_dup 1) (match_dup 2)))]
+  "! TARGET_POWERPC64 && reload_completed"
+  [(set (match_dup 0)
+	(plus:SI (match_dup 1)
+		 (match_dup 2)))
+   (set (match_dup 3)
+	(compare:CC (match_dup 0)
+		    (const_int 0)))]
+  "")
+
+;; Split an add that we can't do in one insn into two insns, each of which
+;; does one 16-bit part.  This is used by combine.  Note that the low-order
+;; add should be last in case the result gets used in an address.
+
+(define_split
+  [(set (match_operand:SI 0 "gpc_reg_operand" "")
+	(plus:SI (match_operand:SI 1 "gpc_reg_operand" "")
+		 (match_operand:SI 2 "non_add_cint_operand" "")))]
+  ""
+  [(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 3)))
+   (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 4)))]
+"
+{
+  HOST_WIDE_INT low = INTVAL (operands[2]) & 0xffff;
+  HOST_WIDE_INT high = INTVAL (operands[2]) & (~ (HOST_WIDE_INT) 0xffff);
+
+  if (low & 0x8000)
+    high += 0x10000, low |= ((HOST_WIDE_INT) -1) << 16;
+
+  operands[3] = GEN_INT (high);
+  operands[4] = GEN_INT (low);
+}")
+
+(define_insn "one_cmplsi2"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(not:SI (match_operand:SI 1 "gpc_reg_operand" "r")))]
+  ""
+  "nor %0,%1,%1")
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
+	(compare:CC (not:SI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 2 "=r,r"))]
+  "! TARGET_POWERPC64"
+  "@
+   nor. %2,%1,%1
+   #"
+  [(set_attr "type" "compare")
+   (set_attr "length" "4,8")])
+
+(define_split
+  [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
+	(compare:CC (not:SI (match_operand:SI 1 "gpc_reg_operand" ""))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 2 ""))]
+  "! TARGET_POWERPC64 && reload_completed"
+  [(set (match_dup 2)
+	(not:SI (match_dup 1)))
+   (set (match_dup 0)
+	(compare:CC (match_dup 2)
+		    (const_int 0)))]
+  "")
+
+(define_insn ""
+  [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
+	(compare:CC (not:SI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(not:SI (match_dup 1)))]
+  "! TARGET_POWERPC64"
+  "@
+   nor. %0,%1,%1
+   #"
+  [(set_attr "type" "compare")
+   (set_attr "length" "4,8")])
+
+(define_split
+  [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
+	(compare:CC (not:SI (match_operand:SI 1 "gpc_reg_operand" ""))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(not:SI (match_dup 1)))]
+  "! TARGET_POWERPC64 && reload_completed"
+  [(set (match_dup 0)
+	(not:SI (match_dup 1)))
+   (set (match_dup 2)
+	(compare:CC (match_dup 0)
+		    (const_int 0)))]
+  "")
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(minus:SI (match_operand:SI 1 "reg_or_short_operand" "rI")
+		  (match_operand:SI 2 "gpc_reg_operand" "r")))]
+  "! TARGET_POWERPC"
+  "{sf%I1|subf%I1c} %0,%2,%1")
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(minus:SI (match_operand:SI 1 "reg_or_short_operand" "r,I")
+		  (match_operand:SI 2 "gpc_reg_operand" "r,r")))]
+  "TARGET_POWERPC"
+  "@
+   subf %0,%2,%1
+   subfic %0,%2,%1")
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
+	(compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+			      (match_operand:SI 2 "gpc_reg_operand" "r,r"))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 "=r,r"))]
+  "! TARGET_POWERPC"
+  "@
+   {sf.|subfc.} %3,%2,%1
+   #"
+  [(set_attr "type" "compare")
+   (set_attr "length" "4,8")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
+	(compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+			      (match_operand:SI 2 "gpc_reg_operand" "r,r"))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 "=r,r"))]
+  "TARGET_POWERPC && ! TARGET_POWERPC64"
+  "@
+   subf. %3,%2,%1
+   #"
+  [(set_attr "type" "compare")
+   (set_attr "length" "4,8")])
+
+(define_split
+  [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
+	(compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "")
+			      (match_operand:SI 2 "gpc_reg_operand" ""))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 ""))]
+  "! TARGET_POWERPC64 && reload_completed"
+  [(set (match_dup 3)
+	(minus:SI (match_dup 1)
+		  (match_dup 2)))
+   (set (match_dup 0)
+	(compare:CC (match_dup 3)
+		    (const_int 0)))]
+  "")
+
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
+	(compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+			      (match_operand:SI 2 "gpc_reg_operand" "r,r"))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(minus:SI (match_dup 1) (match_dup 2)))]
+  "! TARGET_POWERPC"
+  "@
+   {sf.|subfc.} %0,%2,%1
+   #"
+  [(set_attr "type" "compare")
+   (set_attr "length" "4,8")])
+
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
+	(compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+			      (match_operand:SI 2 "gpc_reg_operand" "r,r"))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(minus:SI (match_dup 1)
+		  (match_dup 2)))]
+  "TARGET_POWERPC && ! TARGET_POWERPC64"
+  "@
+   subf. %0,%2,%1
+   #"
+  [(set_attr "type" "compare")
+   (set_attr "length" "4,8")])
+
+(define_split
+  [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
+	(compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "")
+			      (match_operand:SI 2 "gpc_reg_operand" ""))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(minus:SI (match_dup 1)
+		  (match_dup 2)))]
+  "! TARGET_POWERPC64 && reload_completed"
+  [(set (match_dup 0)
+	(minus:SI (match_dup 1)
+		  (match_dup 2)))
+   (set (match_dup 3)
+	(compare:CC (match_dup 0)
+		    (const_int 0)))]
+  "")
+
+(define_expand "subsi3"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "")
+	(minus:SI (match_operand:SI 1 "reg_or_short_operand" "")
+		  (match_operand:SI 2 "reg_or_cint_operand" "")))]
+  ""
+  "
+{
+  if (GET_CODE (operands[2]) == CONST_INT)
+    {
+      emit_insn (gen_addsi3 (operands[0], operands[1],
+			     negate_rtx (SImode, operands[2])));
+      DONE;
+    }
+}")
+
+;; For SMIN, SMAX, UMIN, and UMAX, we use DEFINE_EXPAND's that involve a doz[i]
+;; instruction and some auxiliary computations.  Then we just have a single
+;; DEFINE_INSN for doz[i] and the define_splits to make them if made by
+;; combine.
+
+(define_expand "sminsi3"
+  [(set (match_dup 3)
+	(if_then_else:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "")
+				(match_operand:SI 2 "reg_or_short_operand" ""))
+			 (const_int 0)
+			 (minus:SI (match_dup 2) (match_dup 1))))
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(minus:SI (match_dup 2) (match_dup 3)))]
+  "TARGET_POWER"
+  "
+{ operands[3] = gen_reg_rtx (SImode); }")
+
+(define_split
+  [(set (match_operand:SI 0 "gpc_reg_operand" "")
+	(smin:SI (match_operand:SI 1 "gpc_reg_operand" "")
+		 (match_operand:SI 2 "reg_or_short_operand" "")))
+   (clobber (match_operand:SI 3 "gpc_reg_operand" ""))]
+  "TARGET_POWER"
+  [(set (match_dup 3)
+	(if_then_else:SI (gt:SI (match_dup 1) (match_dup 2))
+			 (const_int 0)
+			 (minus:SI (match_dup 2) (match_dup 1))))
+   (set (match_dup 0) (minus:SI (match_dup 2) (match_dup 3)))]
+  "")
+
+(define_expand "smaxsi3"
+  [(set (match_dup 3)
+	(if_then_else:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "")
+				(match_operand:SI 2 "reg_or_short_operand" ""))
+			 (const_int 0)
+			 (minus:SI (match_dup 2) (match_dup 1))))
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(plus:SI (match_dup 3) (match_dup 1)))]
+  "TARGET_POWER"
+  "
+{ operands[3] = gen_reg_rtx (SImode); }")
+
+(define_split
+  [(set (match_operand:SI 0 "gpc_reg_operand" "")
+	(smax:SI (match_operand:SI 1 "gpc_reg_operand" "")
+		 (match_operand:SI 2 "reg_or_short_operand" "")))
+   (clobber (match_operand:SI 3 "gpc_reg_operand" ""))]
+  "TARGET_POWER"
+  [(set (match_dup 3)
+	(if_then_else:SI (gt:SI (match_dup 1) (match_dup 2))
+			 (const_int 0)
+			 (minus:SI (match_dup 2) (match_dup 1))))
+   (set (match_dup 0) (plus:SI (match_dup 3) (match_dup 1)))]
+  "")
+
+(define_expand "uminsi3"
+  [(set (match_dup 3) (xor:SI (match_operand:SI 1 "gpc_reg_operand" "")
+			      (match_dup 5)))
+   (set (match_dup 4) (xor:SI (match_operand:SI 2 "gpc_reg_operand" "")
+			      (match_dup 5)))
+   (set (match_dup 3) (if_then_else:SI (gt (match_dup 3) (match_dup 4))
+				       (const_int 0)
+				       (minus:SI (match_dup 4) (match_dup 3))))
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(minus:SI (match_dup 2) (match_dup 3)))]
+  "TARGET_POWER"
+  "
+{
+  operands[3] = gen_reg_rtx (SImode);
+  operands[4] = gen_reg_rtx (SImode);
+  operands[5] = GEN_INT (-2147483647 - 1);
+}")
+
+(define_expand "umaxsi3"
+  [(set (match_dup 3) (xor:SI (match_operand:SI 1 "gpc_reg_operand" "")
+			      (match_dup 5)))
+   (set (match_dup 4) (xor:SI (match_operand:SI 2 "gpc_reg_operand" "")
+			      (match_dup 5)))
+   (set (match_dup 3) (if_then_else:SI (gt (match_dup 3) (match_dup 4))
+				       (const_int 0)
+				       (minus:SI (match_dup 4) (match_dup 3))))
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(plus:SI (match_dup 3) (match_dup 1)))]
+  "TARGET_POWER"
+  "
+{
+  operands[3] = gen_reg_rtx (SImode);
+  operands[4] = gen_reg_rtx (SImode);
+  operands[5] = GEN_INT (-2147483647 - 1);
+}")
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(if_then_else:SI (gt (match_operand:SI 1 "gpc_reg_operand" "r")
+			     (match_operand:SI 2 "reg_or_short_operand" "rI"))
+			 (const_int 0)
+			 (minus:SI (match_dup 2) (match_dup 1))))]
+  "TARGET_POWER"
+  "doz%I2 %0,%1,%2")
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC
+	 (if_then_else:SI (gt (match_operand:SI 1 "gpc_reg_operand" "r")
+			      (match_operand:SI 2 "reg_or_short_operand" "rI"))
+			  (const_int 0)
+			  (minus:SI (match_dup 2) (match_dup 1)))
+	 (const_int 0)))
+   (clobber (match_scratch:SI 3 "=r"))]
+  "TARGET_POWER"
+  "doz%I2. %3,%1,%2"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC
+	 (if_then_else:SI (gt (match_operand:SI 1 "gpc_reg_operand" "r")
+			      (match_operand:SI 2 "reg_or_short_operand" "rI"))
+			  (const_int 0)
+			  (minus:SI (match_dup 2) (match_dup 1)))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(if_then_else:SI (gt (match_dup 1) (match_dup 2))
+			 (const_int 0)
+			 (minus:SI (match_dup 2) (match_dup 1))))]
+  "TARGET_POWER"
+  "doz%I2. %0,%1,%2"
+  [(set_attr "type" "delayed_compare")])
+
+;; We don't need abs with condition code because such comparisons should
+;; never be done.
+(define_expand "abssi2"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "")
+	(abs:SI (match_operand:SI 1 "gpc_reg_operand" "")))]
+  ""
+  "
+{
+  if (! TARGET_POWER)
+    {
+      emit_insn (gen_abssi2_nopower (operands[0], operands[1]));
+      DONE;
+    }
+}")
+
+(define_insn "abssi2_power"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(abs:SI (match_operand:SI 1 "gpc_reg_operand" "r")))]
+  "TARGET_POWER"
+  "abs %0,%1")
+
+(define_insn "abssi2_nopower"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=&r,r")
+	(abs:SI (match_operand:SI 1 "gpc_reg_operand" "r,0")))
+   (clobber (match_scratch:SI 2 "=&r,&r"))]
+  "! TARGET_POWER"
+  "*
+{
+  return (TARGET_POWERPC)
+    ? \"{srai|srawi} %2,%1,31\;xor %0,%2,%1\;subf %0,%2,%0\"
+    : \"{srai|srawi} %2,%1,31\;xor %0,%2,%1\;{sf|subfc} %0,%2,%0\";
+}"
+  [(set_attr "length" "12")])
+
+(define_split
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=&r,r")
+	(abs:SI (match_operand:SI 1 "gpc_reg_operand" "r,0")))
+   (clobber (match_scratch:SI 2 "=&r,&r"))]
+  "! TARGET_POWER && reload_completed"
+  [(set (match_dup 2) (ashiftrt:SI (match_dup 1) (const_int 31)))
+   (set (match_dup 0) (xor:SI (match_dup 2) (match_dup 1)))
+   (set (match_dup 0) (minus:SI (match_dup 0) (match_dup 2)))]
+  "")
+
+(define_insn "*nabs_power"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r"))))]
+  "TARGET_POWER"
+  "nabs %0,%1")
+
+(define_insn "*nabs_no_power"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=&r,r")
+	(neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r,0"))))
+   (clobber (match_scratch:SI 2 "=&r,&r"))]
+  "! TARGET_POWER"
+  "*
+{
+  return (TARGET_POWERPC)
+    ? \"{srai|srawi} %2,%1,31\;xor %0,%2,%1\;subf %0,%0,%2\"
+    : \"{srai|srawi} %2,%1,31\;xor %0,%2,%1\;{sf|subfc} %0,%0,%2\";
+}"
+  [(set_attr "length" "12")])
+
+(define_split
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=&r,r")
+	(neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r,0"))))
+   (clobber (match_scratch:SI 2 "=&r,&r"))]
+  "! TARGET_POWER && reload_completed"
+  [(set (match_dup 2) (ashiftrt:SI (match_dup 1) (const_int 31)))
+   (set (match_dup 0) (xor:SI (match_dup 2) (match_dup 1)))
+   (set (match_dup 0) (minus:SI (match_dup 2) (match_dup 0)))]
+  "")
+
+(define_insn "negsi2"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(neg:SI (match_operand:SI 1 "gpc_reg_operand" "r")))]
+  ""
+  "neg %0,%1")
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (neg:SI (match_operand:SI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 2 "=r"))]
+  "! TARGET_POWERPC64"
+  "neg. %2,%1"
+  [(set_attr "type" "compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 2 "cc_reg_operand" "=x")
+	(compare:CC (neg:SI (match_operand:SI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(neg:SI (match_dup 1)))]
+  "! TARGET_POWERPC64"
+  "neg. %0,%1"
+  [(set_attr "type" "compare")])
+
+(define_insn "ffssi2"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=&r")
+	(ffs:SI (match_operand:SI 1 "gpc_reg_operand" "r")))]
+  ""
+  "neg %0,%1\;and %0,%0,%1\;{cntlz|cntlzw} %0,%0\;{sfi|subfic} %0,%0,32"
+  [(set_attr "length" "16")])
+
+(define_expand "mulsi3"
+  [(use (match_operand:SI 0 "gpc_reg_operand" ""))
+   (use (match_operand:SI 1 "gpc_reg_operand" ""))
+   (use (match_operand:SI 2 "reg_or_short_operand" ""))]
+  ""
+  "
+{
+  if (TARGET_POWER)
+    emit_insn (gen_mulsi3_mq (operands[0], operands[1], operands[2]));
+  else
+    emit_insn (gen_mulsi3_no_mq (operands[0], operands[1], operands[2]));
+  DONE;
+}")
+
+(define_insn "mulsi3_mq"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(mult:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r")
+		 (match_operand:SI 2 "reg_or_short_operand" "r,I")))
+   (clobber (match_scratch:SI 3 "=q,q"))]
+  "TARGET_POWER"
+  "@
+   {muls|mullw} %0,%1,%2
+   {muli|mulli} %0,%1,%2"
+   [(set_attr "type" "imul")])
+
+(define_insn "mulsi3_no_mq"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(mult:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r")
+		 (match_operand:SI 2 "reg_or_short_operand" "r,I")))]
+  "! TARGET_POWER"
+  "@
+   {muls|mullw} %0,%1,%2
+   {muli|mulli} %0,%1,%2"
+   [(set_attr "type" "imul")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (mult:SI (match_operand:SI 1 "gpc_reg_operand" "%r")
+			     (match_operand:SI 2 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 "=r"))
+   (clobber (match_scratch:SI 4 "=q"))]
+  "TARGET_POWER"
+  "{muls.|mullw.} %3,%1,%2"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (mult:SI (match_operand:SI 1 "gpc_reg_operand" "%r")
+			     (match_operand:SI 2 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 "=r"))]
+  "! TARGET_POWER"
+  "{muls.|mullw.} %3,%1,%2"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC (mult:SI (match_operand:SI 1 "gpc_reg_operand" "%r")
+			     (match_operand:SI 2 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(mult:SI (match_dup 1) (match_dup 2)))
+   (clobber (match_scratch:SI 4 "=q"))]
+  "TARGET_POWER"
+  "{muls.|mullw.} %0,%1,%2"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC (mult:SI (match_operand:SI 1 "gpc_reg_operand" "%r")
+			     (match_operand:SI 2 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(mult:SI (match_dup 1) (match_dup 2)))]
+  "! TARGET_POWER"
+  "{muls.|mullw.} %0,%1,%2"
+  [(set_attr "type" "delayed_compare")])
+
+;; Operand 1 is divided by operand 2; quotient goes to operand
+;; 0 and remainder to operand 3.
+;; ??? At some point, see what, if anything, we can do about if (x % y == 0).
+
+(define_expand "divmodsi4"
+  [(parallel [(set (match_operand:SI 0 "gpc_reg_operand" "")
+		   (div:SI (match_operand:SI 1 "gpc_reg_operand" "")
+			   (match_operand:SI 2 "gpc_reg_operand" "")))
+	      (set (match_operand:SI 3 "gpc_reg_operand" "")
+		   (mod:SI (match_dup 1) (match_dup 2)))])]
+  "TARGET_POWER || (! TARGET_POWER && ! TARGET_POWERPC)"
+  "
+{
+  if (! TARGET_POWER && ! TARGET_POWERPC)
+    {
+      emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
+      emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
+      emit_insn (gen_divss_call ());
+      emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
+      emit_move_insn (operands[3], gen_rtx_REG (SImode, 4));
+      DONE;
+    }
+}")
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(div:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+		(match_operand:SI 2 "gpc_reg_operand" "r")))
+   (set (match_operand:SI 3 "gpc_reg_operand" "=q")
+	(mod:SI (match_dup 1) (match_dup 2)))]
+  "TARGET_POWER"
+  "divs %0,%1,%2"
+  [(set_attr "type" "idiv")])
+
+(define_expand "udivsi3"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "")
+        (udiv:SI (match_operand:SI 1 "gpc_reg_operand" "")
+                 (match_operand:SI 2 "gpc_reg_operand" "")))]
+  "TARGET_POWERPC || (! TARGET_POWER && ! TARGET_POWERPC)"
+  "
+{
+  if (! TARGET_POWER && ! TARGET_POWERPC)
+    {
+      emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
+      emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
+      emit_insn (gen_quous_call ());
+      emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
+      DONE;
+    }
+  else if (TARGET_POWER)
+    {
+      emit_insn (gen_udivsi3_mq (operands[0], operands[1], operands[2]));
+      DONE;
+    }
+}")
+
+(define_insn "udivsi3_mq"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+        (udiv:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+                 (match_operand:SI 2 "gpc_reg_operand" "r")))
+   (clobber (match_scratch:SI 3 "=q"))]
+  "TARGET_POWERPC && TARGET_POWER"
+  "divwu %0,%1,%2"
+  [(set_attr "type" "idiv")])
+
+(define_insn "*udivsi3_no_mq"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+        (udiv:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+                 (match_operand:SI 2 "gpc_reg_operand" "r")))]
+  "TARGET_POWERPC && ! TARGET_POWER"
+  "divwu %0,%1,%2"
+  [(set_attr "type" "idiv")])
+
+;; For powers of two we can do srai/aze for divide and then adjust for
+;; modulus.  If it isn't a power of two, FAIL on POWER so divmodsi4 will be
+;; used; for PowerPC, force operands into register and do a normal divide;
+;; for AIX common-mode, use quoss call on register operands.
+(define_expand "divsi3"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "")
+	(div:SI (match_operand:SI 1 "gpc_reg_operand" "")
+		(match_operand:SI 2 "reg_or_cint_operand" "")))]
+  ""
+  "
+{
+  if (GET_CODE (operands[2]) == CONST_INT
+      && exact_log2 (INTVAL (operands[2])) >= 0)
+    ;
+  else if (TARGET_POWERPC)
+    {
+      operands[2] = force_reg (SImode, operands[2]);
+      if (TARGET_POWER)
+	{
+	  emit_insn (gen_divsi3_mq (operands[0], operands[1], operands[2]));
+	  DONE;
+	}
+    }
+  else if (TARGET_POWER)
+    FAIL;
+  else
+    {
+      emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
+      emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
+      emit_insn (gen_quoss_call ());
+      emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
+      DONE;
+    }
+}")
+
+(define_insn "divsi3_mq"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+        (div:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+                (match_operand:SI 2 "gpc_reg_operand" "r")))
+   (clobber (match_scratch:SI 3 "=q"))]
+  "TARGET_POWERPC && TARGET_POWER"
+  "divw %0,%1,%2"
+  [(set_attr "type" "idiv")])
+
+(define_insn "*divsi3_no_mq"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+        (div:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+                (match_operand:SI 2 "gpc_reg_operand" "r")))]
+  "TARGET_POWERPC && ! TARGET_POWER"
+  "divw %0,%1,%2"
+  [(set_attr "type" "idiv")])
+
+(define_expand "modsi3"
+  [(use (match_operand:SI 0 "gpc_reg_operand" ""))
+   (use (match_operand:SI 1 "gpc_reg_operand" ""))
+   (use (match_operand:SI 2 "reg_or_cint_operand" ""))]
+  ""
+  "
+{
+  int i = exact_log2 (INTVAL (operands[2]));
+  rtx temp1;
+  rtx temp2;
+
+  if (GET_CODE (operands[2]) != CONST_INT || i < 0)
+    FAIL;
+
+  temp1 = gen_reg_rtx (SImode);
+  temp2 = gen_reg_rtx (SImode);
+
+  emit_insn (gen_divsi3 (temp1, operands[1], operands[2]));
+  emit_insn (gen_ashlsi3 (temp2, temp1, GEN_INT (i)));
+  emit_insn (gen_subsi3 (operands[0], operands[1], temp2));
+  DONE;
+}")
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(div:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+		(match_operand:SI 2 "const_int_operand" "N")))]
+  "exact_log2 (INTVAL (operands[2])) >= 0"
+  "{srai|srawi} %0,%1,%p2\;{aze|addze} %0,%0"
+  [(set_attr "length" "8")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (div:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			    (match_operand:SI 2 "const_int_operand" "N"))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 "=r"))]
+  "exact_log2 (INTVAL (operands[2])) >= 0"
+  "{srai|srawi} %3,%1,%p2\;{aze.|addze.} %3,%3"
+  [(set_attr "type" "compare")
+   (set_attr "length" "8")])
+
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC (div:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			    (match_operand:SI 2 "const_int_operand" "N"))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(div:SI (match_dup 1) (match_dup 2)))]
+  "exact_log2 (INTVAL (operands[2])) >= 0"
+  "{srai|srawi} %0,%1,%p2\;{aze.|addze.} %0,%0"
+  [(set_attr "type" "compare")
+   (set_attr "length" "8")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(udiv:SI
+	 (plus:DI (ashift:DI
+		   (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "r"))
+		   (const_int 32))
+		  (zero_extend:DI (match_operand:SI 4 "register_operand" "2")))
+	 (match_operand:SI 3 "gpc_reg_operand" "r")))
+   (set (match_operand:SI 2 "register_operand" "=*q")
+	(umod:SI
+	 (plus:DI (ashift:DI
+		   (zero_extend:DI (match_dup 1)) (const_int 32))
+		  (zero_extend:DI (match_dup 4)))
+	 (match_dup 3)))]
+  "TARGET_POWER"
+  "div %0,%1,%3"
+  [(set_attr "type" "idiv")])
+
+;; To do unsigned divide we handle the cases of the divisor looking like a
+;; negative number.  If it is a constant that is less than 2**31, we don't
+;; have to worry about the branches.  So make a few subroutines here.
+;;
+;; First comes the normal case.
+(define_expand "udivmodsi4_normal"
+  [(set (match_dup 4) (const_int 0))
+   (parallel [(set (match_operand:SI 0 "" "")
+		   (udiv:SI (plus:DI (ashift:DI (zero_extend:DI (match_dup 4))
+						(const_int 32))
+				     (zero_extend:DI (match_operand:SI 1 "" "")))
+			    (match_operand:SI 2 "" "")))
+	      (set (match_operand:SI 3 "" "")
+		   (umod:SI (plus:DI (ashift:DI (zero_extend:DI (match_dup 4))
+						(const_int 32))
+				     (zero_extend:DI (match_dup 1)))
+			    (match_dup 2)))])]
+  "TARGET_POWER"
+  "
+{ operands[4] = gen_reg_rtx (SImode); }")
+
+;; This handles the branches.
+(define_expand "udivmodsi4_tests"
+  [(set (match_operand:SI 0 "" "") (const_int 0))
+   (set (match_operand:SI 3 "" "") (match_operand:SI 1 "" ""))
+   (set (match_dup 5) (compare:CCUNS (match_dup 1) (match_operand:SI 2 "" "")))
+   (set (pc) (if_then_else (ltu (match_dup 5) (const_int 0))
+			   (label_ref (match_operand:SI 4 "" "")) (pc)))
+   (set (match_dup 0) (const_int 1))
+   (set (match_dup 3) (minus:SI (match_dup 1) (match_dup 2)))
+   (set (match_dup 6) (compare:CC (match_dup 2) (const_int 0)))
+   (set (pc) (if_then_else (lt (match_dup 6) (const_int 0))
+			   (label_ref (match_dup 4)) (pc)))]
+  "TARGET_POWER"
+  "
+{ operands[5] = gen_reg_rtx (CCUNSmode);
+  operands[6] = gen_reg_rtx (CCmode);
+}")
+
+(define_expand "udivmodsi4"
+  [(parallel [(set (match_operand:SI 0 "gpc_reg_operand" "")
+		   (udiv:SI (match_operand:SI 1 "gpc_reg_operand" "")
+			    (match_operand:SI 2 "reg_or_cint_operand" "")))
+	      (set (match_operand:SI 3 "gpc_reg_operand" "")
+		   (umod:SI (match_dup 1) (match_dup 2)))])]
+  ""
+  "
+{
+  rtx label = 0;
+
+  if (! TARGET_POWER)
+    {
+      if (! TARGET_POWERPC)
+        {
+	  emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
+	  emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
+	  emit_insn (gen_divus_call ());
+	  emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
+	  emit_move_insn (operands[3], gen_rtx_REG (SImode, 4));
+	  DONE;
+        }
+      else
+        FAIL;
+    }
+
+  if (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) < 0)
+    {
+      operands[2] = force_reg (SImode, operands[2]);
+      label = gen_label_rtx ();
+      emit (gen_udivmodsi4_tests (operands[0], operands[1], operands[2],
+				  operands[3], label));
+    }
+  else
+    operands[2] = force_reg (SImode, operands[2]);
+
+  emit (gen_udivmodsi4_normal (operands[0], operands[1], operands[2],
+			       operands[3]));
+  if (label)
+    emit_label (label);
+
+  DONE;
+}")
+
+;; AIX architecture-independent common-mode multiply (DImode),
+;; divide/modulus, and quotient subroutine calls.  Input operands in R3 and
+;; R4; results in R3 and sometimes R4; link register always clobbered by bla
+;; instruction; R0 sometimes clobbered; also, MQ sometimes clobbered but
+;; assumed unused if generating common-mode, so ignore.
+(define_insn "mulh_call"
+  [(set (reg:SI 3)
+	(truncate:SI
+	 (lshiftrt:DI (mult:DI (sign_extend:DI (reg:SI 3))
+			       (sign_extend:DI (reg:SI 4)))
+		      (const_int 32))))
+   (clobber (match_scratch:SI 0 "=l"))]
+  "! TARGET_POWER && ! TARGET_POWERPC"
+  "bla __mulh"
+  [(set_attr "type" "imul")])
+
+(define_insn "mull_call"
+  [(set (reg:DI 3)
+	(mult:DI (sign_extend:DI (reg:SI 3))
+		 (sign_extend:DI (reg:SI 4))))
+   (clobber (match_scratch:SI 0 "=l"))
+   (clobber (reg:SI 0))]
+  "! TARGET_POWER && ! TARGET_POWERPC"
+  "bla __mull"
+  [(set_attr "type" "imul")])
+
+(define_insn "divss_call"
+  [(set (reg:SI 3)
+	(div:SI (reg:SI 3) (reg:SI 4)))
+   (set (reg:SI 4)
+	(mod:SI (reg:SI 3) (reg:SI 4)))
+   (clobber (match_scratch:SI 0 "=l"))
+   (clobber (reg:SI 0))]
+  "! TARGET_POWER && ! TARGET_POWERPC"
+  "bla __divss"
+  [(set_attr "type" "idiv")])
+
+(define_insn "divus_call"
+  [(set (reg:SI 3)
+	(udiv:SI (reg:SI 3) (reg:SI 4)))
+   (set (reg:SI 4)
+	(umod:SI (reg:SI 3) (reg:SI 4)))
+   (clobber (match_scratch:SI 0 "=l"))
+   (clobber (reg:SI 0))
+   (clobber (match_scratch:CC 1 "=x"))
+   (clobber (reg:CC 69))]
+  "! TARGET_POWER && ! TARGET_POWERPC"
+  "bla __divus"
+  [(set_attr "type" "idiv")])
+
+(define_insn "quoss_call"
+  [(set (reg:SI 3)
+	(div:SI (reg:SI 3) (reg:SI 4)))
+   (clobber (match_scratch:SI 0 "=l"))]
+  "! TARGET_POWER && ! TARGET_POWERPC"
+  "bla __quoss"
+  [(set_attr "type" "idiv")])
+
+(define_insn "quous_call"
+  [(set (reg:SI 3)
+	(udiv:SI (reg:SI 3) (reg:SI 4)))
+   (clobber (match_scratch:SI 0 "=l"))
+   (clobber (reg:SI 0))
+   (clobber (match_scratch:CC 1 "=x"))
+   (clobber (reg:CC 69))]
+  "! TARGET_POWER && ! TARGET_POWERPC"
+  "bla __quous"
+  [(set_attr "type" "idiv")])
+
+;; Logical instructions
+(define_insn "andsi3"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
+	(and:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r")
+		(match_operand:SI 2 "and_operand" "?r,T,K,J")))
+   (clobber (match_scratch:CC 3 "=X,X,x,x"))]
+  ""
+  "@
+   and %0,%1,%2
+   {rlinm|rlwinm} %0,%1,0,%m2,%M2
+   {andil.|andi.} %0,%1,%b2
+   {andiu.|andis.} %0,%1,%u2"
+  [(set_attr "length" "4")])
+
+;; Note to set cr's other than cr0 we do the and immediate and then
+;; the test again -- this avoids a mcrf which on the higher end
+;; machines causes an execution serialization
+
+(define_insn "*andsi3_internal2"
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,x,x,?y,??y,??y,?y")
+	(compare:CC (and:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r")
+			    (match_operand:SI 2 "and_operand" "r,K,J,T,r,K,J,T"))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 "=r,r,r,r,r,r,r,r"))
+   (clobber (match_scratch:CC 4 "=X,X,X,X,X,x,x,X"))]
+  "! TARGET_POWERPC64"
+  "@
+   and. %3,%1,%2
+   {andil.|andi.} %3,%1,%b2
+   {andiu.|andis.} %3,%1,%u2
+   {rlinm.|rlwinm.} %3,%1,0,%m2,%M2
+   #
+   #
+   #
+   #"
+  [(set_attr "type" "compare,compare,compare,delayed_compare,compare,compare,compare,compare")
+   (set_attr "length" "4,4,4,4,8,8,8,8")])
+
+(define_split
+  [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
+	(compare:CC (and:SI (match_operand:SI 1 "gpc_reg_operand" "")
+			    (match_operand:SI 2 "and_operand" ""))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 ""))
+   (clobber (match_scratch:CC 4 ""))]
+  "! TARGET_POWERPC64 && reload_completed"
+  [(parallel [(set (match_dup 3)
+		   (and:SI (match_dup 1)
+			   (match_dup 2)))
+	      (clobber (match_dup 4))])
+   (set (match_dup 0)
+	(compare:CC (match_dup 3)
+		    (const_int 0)))]
+  "")
+
+(define_insn "*andsi3_internal3"
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,x,x,?y,??y,??y,?y")
+	(compare:CC (and:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r")
+			    (match_operand:SI 2 "and_operand" "r,K,J,T,r,K,J,T"))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r,r,r,r")
+	(and:SI (match_dup 1)
+		(match_dup 2)))
+   (clobber (match_scratch:CC 4 "=X,X,X,X,X,x,x,X"))]
+  "! TARGET_POWERPC64"
+  "@
+   and. %0,%1,%2
+   {andil.|andi.} %0,%1,%b2
+   {andiu.|andis.} %0,%1,%u2
+   {rlinm.|rlwinm.} %0,%1,0,%m2,%M2
+   #
+   #
+   #
+   #"
+  [(set_attr "type" "compare,compare,compare,delayed_compare,compare,compare,compare,compare")
+   (set_attr "length" "4,4,4,4,8,8,8,8")])
+
+(define_split
+  [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
+	(compare:CC (and:SI (match_operand:SI 1 "gpc_reg_operand" "")
+			    (match_operand:SI 2 "and_operand" ""))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(and:SI (match_dup 1)
+		(match_dup 2)))
+   (clobber (match_scratch:CC 4 ""))]
+  "! TARGET_POWERPC64 && reload_completed"
+  [(parallel [(set (match_dup 0)
+		   (and:SI (match_dup 1)
+			   (match_dup 2)))
+	      (clobber (match_dup 4))])
+   (set (match_dup 3)
+	(compare:CC (match_dup 0)
+		    (const_int 0)))]
+  "")
+
+(define_expand "iorsi3"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "")
+	(ior:SI (match_operand:SI 1 "gpc_reg_operand" "")
+		(match_operand:SI 2 "reg_or_cint_operand" "")))]
+  ""
+  "
+{
+  if (GET_CODE (operands[2]) == CONST_INT
+      && ! logical_operand (operands[2], SImode))
+    {
+      HOST_WIDE_INT value = INTVAL (operands[2]);
+      rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1]))
+		 ? operands[0] : gen_reg_rtx (SImode));
+
+      emit_insn (gen_iorsi3 (tmp, operands[1],
+			     GEN_INT (value & (~ (HOST_WIDE_INT) 0xffff))));
+      emit_insn (gen_iorsi3 (operands[0], tmp, GEN_INT (value & 0xffff)));
+      DONE;
+    }
+}")
+
+(define_insn "*iorsi3_internal1"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r")
+	(ior:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r")
+		(match_operand:SI 2 "logical_operand" "r,K,J")))]
+  ""
+  "@
+   or %0,%1,%2
+   {oril|ori} %0,%1,%b2
+   {oriu|oris} %0,%1,%u2"
+  [(set_attr "length" "4,4,4")])
+
+(define_insn "*iorsi3_internal2"
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
+	(compare:CC (ior:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r")
+			    (match_operand:SI 2 "gpc_reg_operand" "r,r"))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 "=r,r"))]
+  "! TARGET_POWERPC64"
+  "@
+   or. %3,%1,%2
+   #"
+  [(set_attr "type" "compare")
+   (set_attr "length" "4,8")])
+
+(define_split
+  [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
+	(compare:CC (ior:SI (match_operand:SI 1 "gpc_reg_operand" "")
+			    (match_operand:SI 2 "gpc_reg_operand" ""))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 ""))]
+  "! TARGET_POWERPC64 && reload_completed"
+  [(set (match_dup 3)
+	(ior:SI (match_dup 1)
+		(match_dup 2)))
+   (set (match_dup 0)
+	(compare:CC (match_dup 3)
+		    (const_int 0)))]
+  "")
+
+(define_insn "*iorsi3_internal3"
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
+	(compare:CC (ior:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r")
+			    (match_operand:SI 2 "gpc_reg_operand" "r,r"))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(ior:SI (match_dup 1)
+		(match_dup 2)))]
+  "! TARGET_POWERPC64"
+  "@
+   or. %0,%1,%2
+   #"
+  [(set_attr "type" "compare")
+   (set_attr "length" "4,8")])
+
+(define_split
+  [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
+	(compare:CC (ior:SI (match_operand:SI 1 "gpc_reg_operand" "")
+			    (match_operand:SI 2 "gpc_reg_operand" ""))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(ior:SI (match_dup 1) (match_dup 2)))]
+  "! TARGET_POWERPC64 && reload_completed"
+  [(set (match_dup 0)
+	(ior:SI (match_dup 1)
+		(match_dup 2)))
+   (set (match_dup 3)
+	(compare:CC (match_dup 0)
+		    (const_int 0)))]
+  "")
+
+;; Split an IOR that we can't do in one insn into two insns, each of which
+;; does one 16-bit part.  This is used by combine.
+
+(define_split
+  [(set (match_operand:SI 0 "gpc_reg_operand" "")
+	(ior:SI (match_operand:SI 1 "gpc_reg_operand" "")
+		(match_operand:SI 2 "non_logical_cint_operand" "")))]
+  ""
+  [(set (match_dup 0) (ior:SI (match_dup 1) (match_dup 3)))
+   (set (match_dup 0) (ior:SI (match_dup 0) (match_dup 4)))]
+"
+{
+  operands[3] = GEN_INT (INTVAL (operands[2]) & (~ (HOST_WIDE_INT) 0xffff));
+  operands[4] = GEN_INT (INTVAL (operands[2]) & 0xffff);
+}")
+
+(define_expand "xorsi3"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "")
+	(xor:SI (match_operand:SI 1 "gpc_reg_operand" "")
+		(match_operand:SI 2 "reg_or_cint_operand" "")))]
+  ""
+  "
+{
+  if (GET_CODE (operands[2]) == CONST_INT
+      && ! logical_operand (operands[2], SImode))
+    {
+      HOST_WIDE_INT value = INTVAL (operands[2]);
+      rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1]))
+		 ? operands[0] : gen_reg_rtx (SImode));
+
+      emit_insn (gen_xorsi3 (tmp, operands[1],
+			     GEN_INT (value & (~ (HOST_WIDE_INT) 0xffff))));
+      emit_insn (gen_xorsi3 (operands[0], tmp, GEN_INT (value & 0xffff)));
+      DONE;
+    }
+}")
+
+(define_insn "*xorsi3_internal1"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r")
+	(xor:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r")
+		(match_operand:SI 2 "logical_operand" "r,K,J")))]
+  ""
+  "@
+   xor %0,%1,%2
+   {xoril|xori} %0,%1,%b2
+   {xoriu|xoris} %0,%1,%u2"
+  [(set_attr "length" "4,4,4")])
+
+(define_insn "*xorsi3_internal2"
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
+	(compare:CC (xor:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r")
+			    (match_operand:SI 2 "gpc_reg_operand" "r,r"))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 "=r,r"))]
+  "! TARGET_POWERPC64"
+  "@
+   xor. %3,%1,%2
+   #"
+  [(set_attr "type" "compare")
+   (set_attr "length" "4,8")])
+
+(define_split
+  [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
+	(compare:CC (xor:SI (match_operand:SI 1 "gpc_reg_operand" "")
+			    (match_operand:SI 2 "gpc_reg_operand" ""))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 ""))]
+  "! TARGET_POWERPC64 && reload_completed"
+  [(set (match_dup 3)
+	(xor:SI (match_dup 1)
+		(match_dup 2)))
+   (set (match_dup 0)
+	(compare:CC (match_dup 3)
+		    (const_int 0)))]
+  "")
+
+(define_insn "*xorsi3_internal3"
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
+	(compare:CC (xor:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r")
+			    (match_operand:SI 2 "gpc_reg_operand" "r,r"))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(xor:SI (match_dup 1)
+		(match_dup 2)))]
+  "! TARGET_POWERPC64"
+  "@
+   xor. %0,%1,%2
+   #"
+  [(set_attr "type" "compare")
+   (set_attr "length" "4,8")])
+
+(define_split
+  [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
+	(compare:CC (xor:SI (match_operand:SI 1 "gpc_reg_operand" "")
+			    (match_operand:SI 2 "gpc_reg_operand" ""))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(xor:SI (match_dup 1) (match_dup 2)))]
+  "! TARGET_POWERPC64 && reload_completed"
+  [(set (match_dup 0)
+	(xor:SI (match_dup 1)
+		(match_dup 2)))
+   (set (match_dup 3)
+	(compare:CC (match_dup 0)
+		    (const_int 0)))]
+  "")
+
+;; Split an XOR that we can't do in one insn into two insns, each of which
+;; does one 16-bit part.  This is used by combine.
+
+(define_split
+  [(set (match_operand:SI 0 "gpc_reg_operand" "")
+        (xor:SI (match_operand:SI 1 "gpc_reg_operand" "")
+                (match_operand:SI 2 "non_logical_cint_operand" "")))]
+  ""
+  [(set (match_dup 0) (xor:SI (match_dup 1) (match_dup 3)))
+   (set (match_dup 0) (xor:SI (match_dup 0) (match_dup 4)))]
+"
+{
+  operands[3] = GEN_INT (INTVAL (operands[2]) & (~ (HOST_WIDE_INT) 0xffff));
+  operands[4] = GEN_INT (INTVAL (operands[2]) & 0xffff);
+}")
+
+(define_insn "*eqvsi3_internal1"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(not:SI (xor:SI (match_operand:SI 1 "gpc_reg_operand" "%r")
+			(match_operand:SI 2 "gpc_reg_operand" "r"))))]
+   ""
+   "eqv %0,%1,%2")
+
+(define_insn "*eqvsi3_internal2"
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
+	(compare:CC (not:SI (xor:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r")
+				    (match_operand:SI 2 "gpc_reg_operand" "r,r")))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 "=r,r"))]
+   "! TARGET_POWERPC64"
+   "@
+    eqv. %3,%1,%2
+    #"
+   [(set_attr "type" "compare")
+   (set_attr "length" "4,8")])
+
+(define_split
+  [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
+	(compare:CC (not:SI (xor:SI (match_operand:SI 1 "gpc_reg_operand" "")
+				    (match_operand:SI 2 "gpc_reg_operand" "")))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 ""))]
+  "! TARGET_POWERPC64 && reload_completed"
+  [(set (match_dup 3)
+	(not:SI (xor:SI (match_dup 1)
+			(match_dup 2))))
+   (set (match_dup 0)
+	(compare:CC (match_dup 3)
+		    (const_int 0)))]
+  "")
+
+(define_insn "*eqvsi3_internal3"
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
+	(compare:CC (not:SI (xor:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r")
+				    (match_operand:SI 2 "gpc_reg_operand" "r,r")))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(not:SI (xor:SI (match_dup 1) (match_dup 2))))]
+   "! TARGET_POWERPC64"
+   "@
+    eqv. %0,%1,%2
+    #"
+   [(set_attr "type" "compare")
+   (set_attr "length" "4,8")])
+
+(define_split
+  [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
+	(compare:CC (not:SI (xor:SI (match_operand:SI 1 "gpc_reg_operand" "")
+				    (match_operand:SI 2 "reg_or_short_operand" "")))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(not:SI (xor:SI (match_dup 1)
+			(match_dup 2))))]
+  "! TARGET_POWERPC64 && reload_completed"
+  [(set (match_dup 0)
+	(not:SI (xor:SI (match_dup 1)
+			(match_dup 2))))
+   (set (match_dup 3)
+	(compare:CC (match_dup 0)
+		    (const_int 0)))]
+  "")
+
+(define_insn "*andcsi3_internal1"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(and:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" "r"))
+		(match_operand:SI 2 "gpc_reg_operand" "r")))]
+  ""
+  "andc %0,%2,%1")
+
+(define_insn "*andcsi3_internal2"
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
+	(compare:CC (and:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
+			    (match_operand:SI 2 "gpc_reg_operand" "r,r"))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 "=r,r"))]
+  "! TARGET_POWERPC64"
+  "@
+   andc. %3,%2,%1
+   #"
+  [(set_attr "type" "compare")
+   (set_attr "length" "4,8")])
+
+(define_split
+  [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
+	(compare:CC (and:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" ""))
+			    (match_operand:SI 2 "gpc_reg_operand" ""))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 ""))]
+  "! TARGET_POWERPC64 && reload_completed"
+  [(set (match_dup 3)
+	(and:SI (not:SI (match_dup 1))
+		(match_dup 2)))
+   (set (match_dup 0)
+	(compare:CC (match_dup 3)
+		    (const_int 0)))]
+  "")
+
+(define_insn "*andcsi3_internal3"
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
+	(compare:CC (and:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
+			    (match_operand:SI 2 "gpc_reg_operand" "r,r"))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(and:SI (not:SI (match_dup 1))
+		(match_dup 2)))]
+  "! TARGET_POWERPC64"
+  "@
+   andc. %0,%2,%1
+   #"
+  [(set_attr "type" "compare")
+   (set_attr "length" "4,8")])
+
+(define_split
+  [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
+	(compare:CC (and:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" ""))
+			    (match_operand:SI 2 "gpc_reg_operand" ""))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(and:SI (not:SI (match_dup 1))
+		(match_dup 2)))]
+  "! TARGET_POWERPC64 && reload_completed"
+  [(set (match_dup 0)
+	(and:SI (not:SI (match_dup 1))
+		(match_dup 2)))
+   (set (match_dup 3)
+	(compare:CC (match_dup 0)
+		    (const_int 0)))]
+  "")
+
+(define_insn "*iorcsi3_internal1"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(ior:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" "r"))
+		(match_operand:SI 2 "gpc_reg_operand" "r")))]
+  ""
+  "orc %0,%2,%1")
+
+(define_insn "*iorcsi3_internal2"
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
+	(compare:CC (ior:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
+			    (match_operand:SI 2 "gpc_reg_operand" "r,r"))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 "=r,r"))]
+  "! TARGET_POWERPC64"
+  "@
+   orc. %3,%2,%1
+   #"
+  [(set_attr "type" "compare")
+   (set_attr "length" "4,8")])
+
+(define_split
+  [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
+	(compare:CC (ior:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" ""))
+			    (match_operand:SI 2 "gpc_reg_operand" ""))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 ""))]
+  "! TARGET_POWERPC64 && reload_completed"
+  [(set (match_dup 3)
+	(ior:SI (not:SI (match_dup 1))
+		(match_dup 2)))
+   (set (match_dup 0)
+	(compare:CC (match_dup 3)
+		    (const_int 0)))]
+  "")
+
+(define_insn "*iorcsi3_internal3"
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
+	(compare:CC (ior:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
+			    (match_operand:SI 2 "gpc_reg_operand" "r,r"))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(ior:SI (not:SI (match_dup 1)) (match_dup 2)))]
+  "! TARGET_POWERPC64"
+  "@
+   orc. %0,%2,%1
+   #"
+  [(set_attr "type" "compare")])
+
+(define_split
+  [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
+	(compare:CC (ior:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" ""))
+			    (match_operand:SI 2 "gpc_reg_operand" ""))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(ior:SI (not:SI (match_dup 1))
+		(match_dup 2)))]
+  "! TARGET_POWERPC64 && reload_completed"
+  [(set (match_dup 0)
+	(ior:SI (not:SI (match_dup 1))
+		(match_dup 2)))
+   (set (match_dup 3)
+	(compare:CC (match_dup 0)
+		    (const_int 0)))]
+  "")
+
+(define_insn "*nandsi3_internal1"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(ior:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" "%r"))
+		(not:SI (match_operand:SI 2 "gpc_reg_operand" "r"))))]
+  ""
+  "nand %0,%1,%2")
+
+(define_insn "*nandsi3_internal2"
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
+	(compare:CC (ior:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r"))
+			    (not:SI (match_operand:SI 2 "gpc_reg_operand" "r,r")))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 "=r,r"))]
+  "! TARGET_POWERPC64"
+  "@
+   nand. %3,%1,%2
+   #"
+  [(set_attr "type" "compare")
+   (set_attr "length" "4,8")])
+
+(define_split
+  [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
+	(compare:CC (ior:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" ""))
+			    (not:SI (match_operand:SI 2 "gpc_reg_operand" "")))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 ""))]
+  "! TARGET_POWERPC64 && reload_completed"
+  [(set (match_dup 3)
+	(ior:SI (not:SI (match_dup 1))
+		(not:SI (match_dup 2))))
+   (set (match_dup 0)
+	(compare:CC (match_dup 3)
+		    (const_int 0)))]
+  "")
+
+(define_insn "*nandsi3_internal3"
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
+	(compare:CC (ior:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r"))
+			    (not:SI (match_operand:SI 2 "gpc_reg_operand" "r,r")))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(ior:SI (not:SI (match_dup 1))
+		(not:SI (match_dup 2))))]
+  "! TARGET_POWERPC64"
+  "@
+   nand. %0,%1,%2
+   #"
+  [(set_attr "type" "compare")
+   (set_attr "length" "4,8")])
+
+(define_split
+  [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
+	(compare:CC (ior:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" ""))
+			    (not:SI (match_operand:SI 2 "gpc_reg_operand" "")))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(ior:SI (not:SI (match_dup 1))
+		(not:SI (match_dup 2))))]
+  "! TARGET_POWERPC64 && reload_completed"
+  [(set (match_dup 0)
+	(ior:SI (not:SI (match_dup 1))
+		(not:SI (match_dup 2))))
+   (set (match_dup 3)
+	(compare:CC (match_dup 0)
+		    (const_int 0)))]
+  "")
+
+(define_insn "*norsi3_internal1"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(and:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" "%r"))
+		(not:SI (match_operand:SI 2 "gpc_reg_operand" "r"))))]
+  ""
+  "nor %0,%1,%2")
+
+(define_insn "*norsi3_internal2"
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
+	(compare:CC (and:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r"))
+			    (not:SI (match_operand:SI 2 "gpc_reg_operand" "r,r")))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 "=r,r"))]
+  "! TARGET_POWERPC64"
+  "@
+   nor. %3,%1,%2
+   #"
+  [(set_attr "type" "compare")
+   (set_attr "length" "4,8")])
+
+(define_split
+  [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
+	(compare:CC (and:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" ""))
+			    (not:SI (match_operand:SI 2 "gpc_reg_operand" "")))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 ""))]
+  "! TARGET_POWERPC64 && reload_completed"
+  [(set (match_dup 3)
+	(and:SI (not:SI (match_dup 1))
+		(not:SI (match_dup 2))))
+   (set (match_dup 0)
+	(compare:CC (match_dup 3)
+		    (const_int 0)))]
+  "")
+
+(define_insn "*norsi3_internal3"
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
+	(compare:CC (and:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r"))
+			    (not:SI (match_operand:SI 2 "gpc_reg_operand" "r,r")))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(and:SI (not:SI (match_dup 1))
+		(not:SI (match_dup 2))))]
+  "! TARGET_POWERPC64"
+  "@
+   nor. %0,%1,%2
+   #"
+  [(set_attr "type" "compare")
+   (set_attr "length" "4,8")])
+
+(define_split
+  [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
+	(compare:CC (and:SI (not:SI (match_operand:SI 1 "gpc_reg_operand" ""))
+			    (not:SI (match_operand:SI 2 "gpc_reg_operand" "")))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(and:SI (not:SI (match_dup 1))
+		(not:SI (match_dup 2))))]
+  "! TARGET_POWERPC64 && reload_completed"
+  [(set (match_dup 0)
+	(and:SI (not:SI (match_dup 1))
+		(not:SI (match_dup 2))))
+   (set (match_dup 3)
+	(compare:CC (match_dup 0)
+		    (const_int 0)))]
+  "")
+
+;; maskir insn.  We need four forms because things might be in arbitrary
+;; orders.  Don't define forms that only set CR fields because these
+;; would modify an input register.
+
+(define_insn "*maskir_internal1"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(ior:SI (and:SI (not:SI (match_operand:SI 2 "gpc_reg_operand" "r"))
+			(match_operand:SI 1 "gpc_reg_operand" "0"))
+		(and:SI (match_dup 2)
+			(match_operand:SI 3 "gpc_reg_operand" "r"))))]
+  "TARGET_POWER"
+  "maskir %0,%3,%2")
+
+(define_insn "*maskir_internal2"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(ior:SI (and:SI (not:SI (match_operand:SI 2 "gpc_reg_operand" "r"))
+			(match_operand:SI 1 "gpc_reg_operand" "0"))
+		(and:SI (match_operand:SI 3 "gpc_reg_operand" "r")
+			(match_dup 2))))]
+  "TARGET_POWER"
+  "maskir %0,%3,%2")
+
+(define_insn "*maskir_internal3"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(ior:SI (and:SI (match_operand:SI 2 "gpc_reg_operand" "r")
+			(match_operand:SI 3 "gpc_reg_operand" "r"))
+		(and:SI (not:SI (match_dup 2))
+			(match_operand:SI 1 "gpc_reg_operand" "0"))))]
+  "TARGET_POWER"
+  "maskir %0,%3,%2")
+
+(define_insn "*maskir_internal4"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(ior:SI (and:SI (match_operand:SI 3 "gpc_reg_operand" "r")
+			(match_operand:SI 2 "gpc_reg_operand" "r"))
+		(and:SI (not:SI (match_dup 2))
+			(match_operand:SI 1 "gpc_reg_operand" "0"))))]
+  "TARGET_POWER"
+  "maskir %0,%3,%2")
+
+(define_insn "*maskir_internal5"
+  [(set (match_operand:CC 4 "cc_reg_operand" "=x")
+	(compare:CC
+	 (ior:SI (and:SI (not:SI (match_operand:SI 2 "gpc_reg_operand" "r"))
+			 (match_operand:SI 1 "gpc_reg_operand" "0"))
+		 (and:SI (match_dup 2)
+			 (match_operand:SI 3 "gpc_reg_operand" "r")))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(ior:SI (and:SI (not:SI (match_dup 2)) (match_dup 1))
+		(and:SI (match_dup 2) (match_dup 3))))]
+  "TARGET_POWER"
+  "maskir. %0,%3,%2"
+  [(set_attr "type" "compare")])
+
+(define_insn "*maskir_internal6"
+  [(set (match_operand:CC 4 "cc_reg_operand" "=x")
+	(compare:CC
+	 (ior:SI (and:SI (not:SI (match_operand:SI 2 "gpc_reg_operand" "r"))
+			 (match_operand:SI 1 "gpc_reg_operand" "0"))
+		 (and:SI (match_operand:SI 3 "gpc_reg_operand" "r")
+			 (match_dup 2)))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(ior:SI (and:SI (not:SI (match_dup 2)) (match_dup 1))
+		(and:SI (match_dup 3) (match_dup 2))))]
+  "TARGET_POWER"
+  "maskir. %0,%3,%2"
+  [(set_attr "type" "compare")])
+
+(define_insn "*maskir_internal7"
+  [(set (match_operand:CC 4 "cc_reg_operand" "=x")
+	(compare:CC
+	 (ior:SI (and:SI (match_operand:SI 2 "gpc_reg_operand" "r")
+			 (match_operand:SI 3 "gpc_reg_operand" "r"))
+		 (and:SI (not:SI (match_dup 2))
+			 (match_operand:SI 1 "gpc_reg_operand" "0")))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(ior:SI (and:SI (match_dup 2) (match_dup 3))
+		(and:SI (not:SI (match_dup 2)) (match_dup 1))))]
+  "TARGET_POWER"
+  "maskir. %0,%3,%2"
+  [(set_attr "type" "compare")])
+
+(define_insn "*maskir_internal8"
+  [(set (match_operand:CC 4 "cc_reg_operand" "=x")
+	(compare:CC
+	 (ior:SI (and:SI (match_operand:SI 3 "gpc_reg_operand" "r")
+			 (match_operand:SI 2 "gpc_reg_operand" "r"))
+		 (and:SI (not:SI (match_dup 2))
+			 (match_operand:SI 1 "gpc_reg_operand" "0")))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(ior:SI (and:SI (match_dup 3) (match_dup 2))
+		(and:SI (not:SI (match_dup 2)) (match_dup 1))))]
+  "TARGET_POWER"
+  "maskir. %0,%3,%2"
+  [(set_attr "type" "compare")])
+
+;; Rotate and shift insns, in all their variants.  These support shifts,
+;; field inserts and extracts, and various combinations thereof.
+(define_expand "insv"
+  [(set (zero_extract (match_operand 0 "gpc_reg_operand" "")
+		       (match_operand:SI 1 "const_int_operand" "")
+		       (match_operand:SI 2 "const_int_operand" ""))
+	(match_operand 3 "gpc_reg_operand" ""))]
+  ""
+  "
+{
+  /* Do not handle 16/8 bit structures that fit in HI/QI modes directly, since
+     the (SUBREG:SI (REG:HI xxx)) that is otherwise generated can confuse the
+     compiler if the address of the structure is taken later.  */
+  if (GET_CODE (operands[0]) == SUBREG
+      && (GET_MODE_SIZE (GET_MODE (SUBREG_REG (operands[0]))) < UNITS_PER_WORD))
+    FAIL;
+
+  if (TARGET_POWERPC64 && GET_MODE (operands[0]) == DImode)
+    emit_insn (gen_insvdi (operands[0], operands[1], operands[2], operands[3]));
+  else
+    emit_insn (gen_insvsi (operands[0], operands[1], operands[2], operands[3]));
+  DONE;
+}")
+
+(define_insn "insvsi"
+  [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
+			 (match_operand:SI 1 "const_int_operand" "i")
+			 (match_operand:SI 2 "const_int_operand" "i"))
+	(match_operand:SI 3 "gpc_reg_operand" "r"))]
+  ""
+  "*
+{
+  int start = INTVAL (operands[2]) & 31;
+  int size = INTVAL (operands[1]) & 31;
+
+  operands[4] = GEN_INT (32 - start - size);
+  operands[1] = GEN_INT (start + size - 1);
+  return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\";
+}")
+
+(define_insn "*insvsi_internal1"
+  [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
+			 (match_operand:SI 1 "const_int_operand" "i")
+			 (match_operand:SI 2 "const_int_operand" "i"))
+	(ashift:SI (match_operand:SI 3 "gpc_reg_operand" "r")
+		   (match_operand:SI 4 "const_int_operand" "i")))]
+  "(32 - (INTVAL (operands[4]) & 31)) >= INTVAL (operands[1])"
+  "*
+{
+  int shift = INTVAL (operands[4]) & 31;
+  int start = INTVAL (operands[2]) & 31;
+  int size = INTVAL (operands[1]) & 31;
+
+  operands[4] = GEN_INT (shift - start - size);
+  operands[1] = GEN_INT (start + size - 1);
+  return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\";
+}")
+
+(define_insn "*insvsi_internal2"
+  [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
+			 (match_operand:SI 1 "const_int_operand" "i")
+			 (match_operand:SI 2 "const_int_operand" "i"))
+	(ashiftrt:SI (match_operand:SI 3 "gpc_reg_operand" "r")
+		     (match_operand:SI 4 "const_int_operand" "i")))]
+  "(32 - (INTVAL (operands[4]) & 31)) >= INTVAL (operands[1])"
+  "*
+{
+  int shift = INTVAL (operands[4]) & 31;
+  int start = INTVAL (operands[2]) & 31;
+  int size = INTVAL (operands[1]) & 31;
+
+  operands[4] = GEN_INT (32 - shift - start - size);
+  operands[1] = GEN_INT (start + size - 1);
+  return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\";
+}")
+
+(define_insn "*insvsi_internal3"
+  [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
+			 (match_operand:SI 1 "const_int_operand" "i")
+			 (match_operand:SI 2 "const_int_operand" "i"))
+	(lshiftrt:SI (match_operand:SI 3 "gpc_reg_operand" "r")
+		     (match_operand:SI 4 "const_int_operand" "i")))]
+  "(32 - (INTVAL (operands[4]) & 31)) >= INTVAL (operands[1])"
+  "*
+{
+  int shift = INTVAL (operands[4]) & 31;
+  int start = INTVAL (operands[2]) & 31;
+  int size = INTVAL (operands[1]) & 31;
+
+  operands[4] = GEN_INT (32 - shift - start - size);
+  operands[1] = GEN_INT (start + size - 1);
+  return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\";
+}")
+
+(define_insn "*insvsi_internal4"
+  [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
+			 (match_operand:SI 1 "const_int_operand" "i")
+			 (match_operand:SI 2 "const_int_operand" "i"))
+	(zero_extract:SI (match_operand:SI 3 "gpc_reg_operand" "r")
+			 (match_operand:SI 4 "const_int_operand" "i")
+			 (match_operand:SI 5 "const_int_operand" "i")))]
+  "INTVAL (operands[4]) >= INTVAL (operands[1])"
+  "*
+{
+  int extract_start = INTVAL (operands[5]) & 31;
+  int extract_size = INTVAL (operands[4]) & 31;
+  int insert_start = INTVAL (operands[2]) & 31;
+  int insert_size = INTVAL (operands[1]) & 31;
+
+/* Align extract field with insert field */
+  operands[5] = GEN_INT (extract_start + extract_size - insert_start - insert_size);
+  operands[1] = GEN_INT (insert_start + insert_size - 1);
+  return \"{rlimi|rlwimi} %0,%3,%h5,%h2,%h1\";
+}")
+
+(define_insn "insvdi"
+  [(set (zero_extract:DI (match_operand:DI 0 "gpc_reg_operand" "+r")
+			 (match_operand:SI 1 "const_int_operand" "i")
+			 (match_operand:SI 2 "const_int_operand" "i"))
+	(match_operand:DI 3 "gpc_reg_operand" "r"))]
+  "TARGET_POWERPC64"
+  "*
+{
+  int start = INTVAL (operands[2]) & 63;
+  int size = INTVAL (operands[1]) & 63;
+
+  operands[1] = GEN_INT (64 - start - size);
+  return \"rldimi %0,%3,%H1,%H2\";
+}")
+
+(define_expand "extzv"
+  [(set (match_operand 0 "gpc_reg_operand" "")
+	(zero_extract (match_operand 1 "gpc_reg_operand" "")
+		       (match_operand:SI 2 "const_int_operand" "")
+		       (match_operand:SI 3 "const_int_operand" "")))]
+  ""
+  "
+{
+  /* Do not handle 16/8 bit structures that fit in HI/QI modes directly, since
+     the (SUBREG:SI (REG:HI xxx)) that is otherwise generated can confuse the
+     compiler if the address of the structure is taken later.  */
+  if (GET_CODE (operands[0]) == SUBREG
+      && (GET_MODE_SIZE (GET_MODE (SUBREG_REG (operands[0]))) < UNITS_PER_WORD))
+    FAIL;
+
+  if (TARGET_POWERPC64 && GET_MODE (operands[1]) == DImode)
+    emit_insn (gen_extzvdi (operands[0], operands[1], operands[2], operands[3]));
+  else
+    emit_insn (gen_extzvsi (operands[0], operands[1], operands[2], operands[3]));
+  DONE;
+}")
+
+(define_insn "extzvsi"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(zero_extract:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			 (match_operand:SI 2 "const_int_operand" "i")
+			 (match_operand:SI 3 "const_int_operand" "i")))]
+  ""
+  "*
+{
+  int start = INTVAL (operands[3]) & 31;
+  int size = INTVAL (operands[2]) & 31;
+
+  if (start + size >= 32)
+    operands[3] = const0_rtx;
+  else
+    operands[3] = GEN_INT (start + size);
+  return \"{rlinm|rlwinm} %0,%1,%3,%s2,31\";
+}")
+
+(define_insn "*extzvsi_internal1"
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (zero_extract:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			 (match_operand:SI 2 "const_int_operand" "i")
+			 (match_operand:SI 3 "const_int_operand" "i"))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 4 "=r"))]
+  "! TARGET_POWERPC64"
+  "*
+{
+  int start = INTVAL (operands[3]) & 31;
+  int size = INTVAL (operands[2]) & 31;
+
+  /* If the bitfield being tested fits in the upper or lower half of a
+     word, it is possible to use andiu. or andil. to test it.  This is
+     useful because the condition register set-use delay is smaller for
+     andi[ul]. than for rlinm.  This doesn't work when the starting bit
+     position is 0 because the LT and GT bits may be set wrong.  */
+
+  if ((start > 0 && start + size <= 16) || start >= 16)
+    {
+      operands[3] = GEN_INT (((1 << (16 - (start & 15)))
+			      - (1 << (16 - (start & 15) - size))));
+      if (start < 16)
+	return \"{andiu.|andis.} %4,%1,%3\";
+      else
+	return \"{andil.|andi.} %4,%1,%3\";
+    }
+
+  if (start + size >= 32)
+    operands[3] = const0_rtx;
+  else
+    operands[3] = GEN_INT (start + size);
+  return \"{rlinm.|rlwinm.} %4,%1,%3,%s2,31\";
+}"
+  [(set_attr "type" "compare")])
+
+(define_insn "*extzvsi_internal2"
+  [(set (match_operand:CC 4 "cc_reg_operand" "=x")
+	(compare:CC (zero_extract:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			 (match_operand:SI 2 "const_int_operand" "i")
+			 (match_operand:SI 3 "const_int_operand" "i"))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(zero_extract:SI (match_dup 1) (match_dup 2) (match_dup 3)))]
+  "! TARGET_POWERPC64"
+  "*
+{
+  int start = INTVAL (operands[3]) & 31;
+  int size = INTVAL (operands[2]) & 31;
+
+  if (start >= 16 && start + size == 32)
+    {
+      operands[3] = GEN_INT ((1 << (32 - start)) - 1);
+      return \"{andil.|andi.} %0,%1,%3\";
+    }
+
+  if (start + size >= 32)
+    operands[3] = const0_rtx;
+  else
+    operands[3] = GEN_INT (start + size);
+  return \"{rlinm.|rlwinm.} %0,%1,%3,%s2,31\";
+}"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn "extzvdi"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(zero_extract:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+			 (match_operand:SI 2 "const_int_operand" "i")
+			 (match_operand:SI 3 "const_int_operand" "i")))]
+  "TARGET_POWERPC64"
+  "*
+{
+  int start = INTVAL (operands[3]) & 63;
+  int size = INTVAL (operands[2]) & 63;
+
+  if (start + size >= 64)
+    operands[3] = const0_rtx;
+  else
+    operands[3] = GEN_INT (start + size);
+  operands[2] = GEN_INT (64 - size);
+  return \"rldicl %0,%1,%3,%2\";
+}")
+
+(define_insn "*extzvdi_internal1"
+  [(set (match_operand:CC 0 "gpc_reg_operand" "=x")
+	(compare:CC (zero_extract:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+			 (match_operand:SI 2 "const_int_operand" "i")
+			 (match_operand:SI 3 "const_int_operand" "i"))
+		    (const_int 0)))
+   (clobber (match_scratch:DI 4 "=r"))]
+  "TARGET_POWERPC64"
+  "*
+{
+  int start = INTVAL (operands[3]) & 63;
+  int size = INTVAL (operands[2]) & 63;
+
+  if (start + size >= 64)
+    operands[3] = const0_rtx;
+  else
+    operands[3] = GEN_INT (start + size);
+  operands[2] = GEN_INT (64 - size);
+  return \"rldicl. %4,%1,%3,%2\";
+}")
+
+(define_insn "*extzvdi_internal2"
+  [(set (match_operand:CC 4 "gpc_reg_operand" "=x")
+	(compare:CC (zero_extract:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+			 (match_operand:SI 2 "const_int_operand" "i")
+			 (match_operand:SI 3 "const_int_operand" "i"))
+		    (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(zero_extract:DI (match_dup 1) (match_dup 2) (match_dup 3)))]
+  "TARGET_POWERPC64"
+  "*
+{
+  int start = INTVAL (operands[3]) & 63;
+  int size = INTVAL (operands[2]) & 63;
+
+  if (start + size >= 64)
+    operands[3] = const0_rtx;
+  else
+    operands[3] = GEN_INT (start + size);
+  operands[2] = GEN_INT (64 - size);
+  return \"rldicl. %0,%1,%3,%2\";
+}")
+
+(define_insn "rotlsi3"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+		   (match_operand:SI 2 "reg_or_cint_operand" "ri")))]
+  ""
+  "{rl%I2nm|rlw%I2nm} %0,%1,%h2,0xffffffff")
+
+(define_insn "*rotlsi3_internal2"
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			       (match_operand:SI 2 "reg_or_cint_operand" "ri"))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 "=r"))]
+  "! TARGET_POWERPC64"
+  "{rl%I2nm.|rlw%I2nm.} %3,%1,%h2,0xffffffff"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn "*rotlsi3_internal3"
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			       (match_operand:SI 2 "reg_or_cint_operand" "ri"))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(rotate:SI (match_dup 1) (match_dup 2)))]
+  "! TARGET_POWERPC64"
+  "{rl%I2nm.|rlw%I2nm.} %0,%1,%h2,0xffffffff"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn "*rotlsi3_internal4"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(and:SI (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			   (match_operand:SI 2 "reg_or_cint_operand" "ri"))
+		(match_operand:SI 3 "mask_operand" "T")))]
+  ""
+  "{rl%I2nm|rlw%I2nm} %0,%1,%h2,%m3,%M3")
+
+(define_insn "*rotlsi3_internal5"
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (and:SI
+		     (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+				(match_operand:SI 2 "reg_or_cint_operand" "ri"))
+		     (match_operand:SI 3 "mask_operand" "T"))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 4 "=r"))]
+  "! TARGET_POWERPC64"
+  "{rl%I2nm.|rlw%I2nm.} %4,%1,%h2,%m3,%M3"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn "*rotlsi3_internal6"
+  [(set (match_operand:CC 4 "cc_reg_operand" "=x")
+	(compare:CC (and:SI
+		     (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+				(match_operand:SI 2 "reg_or_cint_operand" "ri"))
+		     (match_operand:SI 3 "mask_operand" "T"))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(and:SI (rotate:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
+  "! TARGET_POWERPC64"
+  "{rl%I2nm.|rlw%I2nm.} %0,%1,%h2,%m3,%M3"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn "*rotlsi3_internal7"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(zero_extend:SI
+	 (subreg:QI
+	  (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+		     (match_operand:SI 2 "reg_or_cint_operand" "ri")) 0)))]
+  ""
+  "{rl%I2nm|rlw%I2nm} %0,%1,%h2,0xff")
+
+(define_insn "*rotlsi3_internal8"
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (zero_extend:SI
+		     (subreg:QI
+		      (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+				 (match_operand:SI 2 "reg_or_cint_operand" "ri")) 0))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 "=r"))]
+  ""
+  "{rl%I2nm.|rlw%I2nm.} %3,%1,%h2,0xff"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn "*rotlsi3_internal9"
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC (zero_extend:SI
+		     (subreg:QI
+		      (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+				 (match_operand:SI 2 "reg_or_cint_operand" "ri")) 0))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(zero_extend:SI (subreg:QI (rotate:SI (match_dup 1) (match_dup 2)) 0)))]
+  ""
+  "{rl%I2nm.|rlw%I2nm.} %0,%1,%h2,0xff"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn "*rotlsi3_internal10"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(zero_extend:SI
+	 (subreg:HI
+	  (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+		     (match_operand:SI 2 "reg_or_cint_operand" "ri")) 0)))]
+  ""
+  "{rl%I2nm|rlw%I2nm} %0,%1,%h2,0xffff")
+
+(define_insn "*rotlsi3_internal11"
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (zero_extend:SI
+		     (subreg:HI
+		      (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+				 (match_operand:SI 2 "reg_or_cint_operand" "ri")) 0))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 "=r"))]
+  ""
+  "{rl%I2nm.|rlw%I2nm.} %3,%1,%h2,0xffff"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn "*rotlsi3_internal12"
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC (zero_extend:SI
+		     (subreg:HI
+		      (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+				 (match_operand:SI 2 "reg_or_cint_operand" "ri")) 0))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(zero_extend:SI (subreg:HI (rotate:SI (match_dup 1) (match_dup 2)) 0)))]
+  ""
+  "{rl%I2nm.|rlw%I2nm.} %0,%1,%h2,0xffff"
+  [(set_attr "type" "delayed_compare")])
+
+;; Note that we use "sle." instead of "sl." so that we can set
+;; SHIFT_COUNT_TRUNCATED.
+
+(define_expand "ashlsi3"
+  [(use (match_operand:SI 0 "gpc_reg_operand" ""))
+   (use (match_operand:SI 1 "gpc_reg_operand" ""))
+   (use (match_operand:SI 2 "reg_or_cint_operand" ""))]
+  ""
+  "
+{
+  if (TARGET_POWER)
+    emit_insn (gen_ashlsi3_power (operands[0], operands[1], operands[2]));
+  else
+    emit_insn (gen_ashlsi3_no_power (operands[0], operands[1], operands[2]));
+  DONE;
+}")
+
+(define_insn "ashlsi3_power"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+		   (match_operand:SI 2 "reg_or_cint_operand" "r,i")))
+   (clobber (match_scratch:SI 3 "=q,X"))]
+  "TARGET_POWER"
+  "@
+   sle %0,%1,%2
+   {sli|slwi} %0,%1,%h2")
+
+(define_insn "ashlsi3_no_power"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+		   (match_operand:SI 2 "reg_or_cint_operand" "ri")))]
+  "! TARGET_POWER"
+  "{sl|slw}%I2 %0,%1,%h2")
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x,x")
+	(compare:CC (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+			       (match_operand:SI 2 "reg_or_cint_operand" "r,i"))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 "=r,r"))
+   (clobber (match_scratch:SI 4 "=q,X"))]
+  "TARGET_POWER"
+  "@
+   sle. %3,%1,%2
+   {sli.|slwi.} %3,%1,%h2"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			       (match_operand:SI 2 "reg_or_cint_operand" "ri"))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 "=r"))]
+  "! TARGET_POWER && ! TARGET_POWERPC64"
+  "{sl|slw}%I2. %3,%1,%h2"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x,x")
+	(compare:CC (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+			       (match_operand:SI 2 "reg_or_cint_operand" "r,i"))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(ashift:SI (match_dup 1) (match_dup 2)))
+   (clobber (match_scratch:SI 4 "=q,X"))]
+  "TARGET_POWER"
+  "@
+   sle. %0,%1,%2
+   {sli.|slwi.} %0,%1,%h2"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			       (match_operand:SI 2 "reg_or_cint_operand" "ri"))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(ashift:SI (match_dup 1) (match_dup 2)))]
+  "! TARGET_POWER && ! TARGET_POWERPC64"
+  "{sl|slw}%I2. %0,%1,%h2"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(and:SI (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			   (match_operand:SI 2 "const_int_operand" "i"))
+		(match_operand:SI 3 "mask_operand" "T")))]
+  "includes_lshift_p (operands[2], operands[3])"
+  "{rlinm|rlwinm} %0,%1,%h2,%m3,%M3")
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC
+	 (and:SI (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			    (match_operand:SI 2 "const_int_operand" "i"))
+		 (match_operand:SI 3 "mask_operand" "T"))
+	 (const_int 0)))
+   (clobber (match_scratch:SI 4 "=r"))]
+  "! TARGET_POWERPC64 && includes_lshift_p (operands[2], operands[3])"
+  "{rlinm.|rlwinm.} %4,%1,%h2,%m3,%M3"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 4 "cc_reg_operand" "=x")
+	(compare:CC
+	 (and:SI (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			    (match_operand:SI 2 "const_int_operand" "i"))
+		 (match_operand:SI 3 "mask_operand" "T"))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(and:SI (ashift:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
+  "! TARGET_POWERPC64 && includes_lshift_p (operands[2], operands[3])"
+  "{rlinm.|rlwinm.} %0,%1,%h2,%m3,%M3"
+  [(set_attr "type" "delayed_compare")])
+
+;; The AIX assembler mis-handles "sri x,x,0", so write that case as
+;; "sli x,x,0".
+(define_expand "lshrsi3"
+  [(use (match_operand:SI 0 "gpc_reg_operand" ""))
+   (use (match_operand:SI 1 "gpc_reg_operand" ""))
+   (use (match_operand:SI 2 "reg_or_cint_operand" ""))]
+  ""
+  "
+{
+  if (TARGET_POWER)
+    emit_insn (gen_lshrsi3_power (operands[0], operands[1], operands[2]));
+  else
+    emit_insn (gen_lshrsi3_no_power (operands[0], operands[1], operands[2]));
+  DONE;
+}")
+
+(define_insn "lshrsi3_power"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r")
+	(lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r")
+		     (match_operand:SI 2 "reg_or_cint_operand" "r,O,i")))
+   (clobber (match_scratch:SI 3 "=q,X,X"))]
+  "TARGET_POWER"
+  "@
+  sre %0,%1,%2
+  mr %0,%1
+  {s%A2i|s%A2wi} %0,%1,%h2")
+
+(define_insn "lshrsi3_no_power"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+		     (match_operand:SI 2 "reg_or_cint_operand" "O,ri")))]
+  "! TARGET_POWER"
+  "@
+  mr %0,%1
+  {sr|srw}%I2 %0,%1,%h2")
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,x")
+	(compare:CC (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r")
+				 (match_operand:SI 2 "reg_or_cint_operand" "r,O,i"))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 "=r,X,r"))
+   (clobber (match_scratch:SI 4 "=q,X,X"))]
+  "TARGET_POWER"
+  "@
+  sre. %3,%1,%2
+  mr. %1,%1
+  {s%A2i.|s%A2wi.} %3,%1,%h2"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x,x")
+	(compare:CC (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+				 (match_operand:SI 2 "reg_or_cint_operand" "O,ri"))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 "=X,r"))]
+  "! TARGET_POWER && ! TARGET_POWERPC64"
+  "@
+   mr. %1,%1
+   {sr|srw}%I2. %3,%1,%h2"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,x")
+	(compare:CC (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r")
+				 (match_operand:SI 2 "reg_or_cint_operand" "r,O,i"))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r")
+	(lshiftrt:SI (match_dup 1) (match_dup 2)))
+   (clobber (match_scratch:SI 4 "=q,X,X"))]
+  "TARGET_POWER"
+  "@
+  sre. %0,%1,%2
+  mr. %0,%1
+  {s%A2i.|s%A2wi.} %0,%1,%h2"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x,x")
+	(compare:CC (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+				 (match_operand:SI 2 "reg_or_cint_operand" "O,ri"))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(lshiftrt:SI (match_dup 1) (match_dup 2)))]
+  "! TARGET_POWER && ! TARGET_POWERPC64"
+  "@
+   mr. %0,%1
+   {sr|srw}%I2. %0,%1,%h2"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(and:SI (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			     (match_operand:SI 2 "const_int_operand" "i"))
+		(match_operand:SI 3 "mask_operand" "T")))]
+  "includes_rshift_p (operands[2], operands[3])"
+  "{rlinm|rlwinm} %0,%1,%s2,%m3,%M3")
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC
+	 (and:SI (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			      (match_operand:SI 2 "const_int_operand" "i"))
+		 (match_operand:SI 3 "mask_operand" "T"))
+	 (const_int 0)))
+   (clobber (match_scratch:SI 4 "=r"))]
+  "! TARGET_POWERPC64 && includes_rshift_p (operands[2], operands[3])"
+  "{rlinm.|rlwinm.} %4,%1,%s2,%m3,%M3"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 4 "cc_reg_operand" "=x")
+	(compare:CC
+	 (and:SI (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			      (match_operand:SI 2 "const_int_operand" "i"))
+		 (match_operand:SI 3 "mask_operand" "T"))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(and:SI (lshiftrt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
+  "! TARGET_POWERPC64 && includes_rshift_p (operands[2], operands[3])"
+  "{rlinm.|rlwinm.} %0,%1,%s2,%m3,%M3"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(zero_extend:SI
+	 (subreg:QI
+	  (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+		       (match_operand:SI 2 "const_int_operand" "i")) 0)))]
+  "includes_rshift_p (operands[2], GEN_INT (255))"
+  "{rlinm|rlwinm} %0,%1,%s2,0xff")
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC
+	 (zero_extend:SI
+	  (subreg:QI
+	   (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			(match_operand:SI 2 "const_int_operand" "i")) 0))
+	 (const_int 0)))
+   (clobber (match_scratch:SI 3 "=r"))]
+  "includes_rshift_p (operands[2], GEN_INT (255))"
+  "{rlinm.|rlwinm.} %3,%1,%s2,0xff"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC
+	 (zero_extend:SI
+	  (subreg:QI
+	   (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			(match_operand:SI 2 "const_int_operand" "i")) 0))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(zero_extend:SI (subreg:QI (lshiftrt:SI (match_dup 1) (match_dup 2)) 0)))]
+  "includes_rshift_p (operands[2], GEN_INT (255))"
+  "{rlinm.|rlwinm.} %0,%1,%s2,0xff"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(zero_extend:SI
+	 (subreg:HI
+	  (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+		       (match_operand:SI 2 "const_int_operand" "i")) 0)))]
+  "includes_rshift_p (operands[2], GEN_INT (65535))"
+  "{rlinm|rlwinm} %0,%1,%s2,0xffff")
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC
+	 (zero_extend:SI
+	  (subreg:HI
+	   (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			(match_operand:SI 2 "const_int_operand" "i")) 0))
+	 (const_int 0)))
+   (clobber (match_scratch:SI 3 "=r"))]
+  "includes_rshift_p (operands[2], GEN_INT (65535))"
+  "{rlinm.|rlwinm.} %3,%1,%s2,0xffff"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC
+	 (zero_extend:SI
+	  (subreg:HI
+	   (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			(match_operand:SI 2 "const_int_operand" "i")) 0))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(zero_extend:SI (subreg:HI (lshiftrt:SI (match_dup 1) (match_dup 2)) 0)))]
+  "includes_rshift_p (operands[2], GEN_INT (65535))"
+  "{rlinm.|rlwinm.} %0,%1,%s2,0xffff"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn ""
+  [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
+			 (const_int 1)
+			 (match_operand:SI 1 "gpc_reg_operand" "r"))
+	(ashiftrt:SI (match_operand:SI 2 "gpc_reg_operand" "r")
+		     (const_int 31)))]
+  "TARGET_POWER"
+  "rrib %0,%1,%2")
+
+(define_insn ""
+  [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
+			 (const_int 1)
+			 (match_operand:SI 1 "gpc_reg_operand" "r"))
+	(lshiftrt:SI (match_operand:SI 2 "gpc_reg_operand" "r")
+		     (const_int 31)))]
+  "TARGET_POWER"
+  "rrib %0,%1,%2")
+
+(define_insn ""
+  [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
+			 (const_int 1)
+			 (match_operand:SI 1 "gpc_reg_operand" "r"))
+	(zero_extract:SI (match_operand:SI 2 "gpc_reg_operand" "r")
+			 (const_int 1)
+			 (const_int 0)))]
+  "TARGET_POWER"
+  "rrib %0,%1,%2")
+
+(define_expand "ashrsi3"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "")
+	(ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
+		     (match_operand:SI 2 "reg_or_cint_operand" "")))]
+  ""
+  "
+{
+  if (TARGET_POWER)
+    emit_insn (gen_ashrsi3_power (operands[0], operands[1], operands[2]));
+  else
+    emit_insn (gen_ashrsi3_no_power (operands[0], operands[1], operands[2]));
+  DONE;
+}")
+
+(define_insn "ashrsi3_power"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+		     (match_operand:SI 2 "reg_or_cint_operand" "r,i")))
+   (clobber (match_scratch:SI 3 "=q,X"))]
+  "TARGET_POWER"
+  "@
+   srea %0,%1,%2
+   {srai|srawi} %0,%1,%h2")
+
+(define_insn "ashrsi3_no_power"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+		     (match_operand:SI 2 "reg_or_cint_operand" "ri")))]
+  "! TARGET_POWER"
+  "{sra|sraw}%I2 %0,%1,%h2")
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x,x")
+	(compare:CC (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+				 (match_operand:SI 2 "reg_or_cint_operand" "r,i"))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 "=r,r"))
+   (clobber (match_scratch:SI 4 "=q,X"))]
+  "TARGET_POWER"
+  "@
+   srea. %3,%1,%2
+   {srai.|srawi.} %3,%1,%h2"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+				 (match_operand:SI 2 "reg_or_cint_operand" "ri"))
+		    (const_int 0)))
+   (clobber (match_scratch:SI 3 "=r"))]
+  "! TARGET_POWER"
+  "{sra|sraw}%I2. %3,%1,%h2"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x,x")
+	(compare:CC (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+				 (match_operand:SI 2 "reg_or_cint_operand" "r,i"))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(ashiftrt:SI (match_dup 1) (match_dup 2)))
+   (clobber (match_scratch:SI 4 "=q,X"))]
+  "TARGET_POWER"
+  "@
+   srea. %0,%1,%2
+   {srai.|srawi.} %0,%1,%h2"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+				 (match_operand:SI 2 "reg_or_cint_operand" "ri"))
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(ashiftrt:SI (match_dup 1) (match_dup 2)))]
+  "! TARGET_POWER"
+  "{sra|sraw}%I2. %0,%1,%h2"
+  [(set_attr "type" "delayed_compare")])
+
+;; Floating-point insns, excluding normal data motion.
+;;
+;; PowerPC has a full set of single-precision floating point instructions.
+;;
+;; For the POWER architecture, we pretend that we have both SFmode and
+;; DFmode insns, while, in fact, all fp insns are actually done in double.
+;; The only conversions we will do will be when storing to memory.  In that
+;; case, we will use the "frsp" instruction before storing.
+;;
+;; Note that when we store into a single-precision memory location, we need to
+;; use the frsp insn first.  If the register being stored isn't dead, we
+;; need a scratch register for the frsp.  But this is difficult when the store
+;; is done by reload.  It is not incorrect to do the frsp on the register in
+;; this case, we just lose precision that we would have otherwise gotten but
+;; is not guaranteed.  Perhaps this should be tightened up at some point.
+
+(define_insn "extendsfdf2"
+  [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
+	(float_extend:DF (match_operand:SF 1 "gpc_reg_operand" "f")))]
+  "TARGET_HARD_FLOAT"
+  "*
+{
+  if (REGNO (operands[0]) == REGNO (operands[1]))
+    return \"\";
+  else
+    return \"fmr %0,%1\";
+}"
+  [(set_attr "type" "fp")])
+
+(define_insn "truncdfsf2"
+  [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
+	(float_truncate:SF (match_operand:DF 1 "gpc_reg_operand" "f")))]
+  "TARGET_HARD_FLOAT"
+  "frsp %0,%1"
+  [(set_attr "type" "fp")])
+
+(define_insn "aux_truncdfsf2"
+  [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
+	(unspec:SF [(match_operand:SF 1 "gpc_reg_operand" "f")] 0))]
+  "! TARGET_POWERPC && TARGET_HARD_FLOAT"
+  "frsp %0,%1"
+  [(set_attr "type" "fp")])
+
+(define_insn "negsf2"
+  [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
+	(neg:SF (match_operand:SF 1 "gpc_reg_operand" "f")))]
+  "TARGET_HARD_FLOAT"
+  "fneg %0,%1"
+  [(set_attr "type" "fp")])
+
+(define_insn "abssf2"
+  [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
+	(abs:SF (match_operand:SF 1 "gpc_reg_operand" "f")))]
+  "TARGET_HARD_FLOAT"
+  "fabs %0,%1"
+  [(set_attr "type" "fp")])
+
+(define_insn ""
+  [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
+	(neg:SF (abs:SF (match_operand:SF 1 "gpc_reg_operand" "f"))))]
+  "TARGET_HARD_FLOAT"
+  "fnabs %0,%1"
+  [(set_attr "type" "fp")])
+
+(define_expand "addsf3"
+  [(set (match_operand:SF 0 "gpc_reg_operand" "")
+	(plus:SF (match_operand:SF 1 "gpc_reg_operand" "")
+		 (match_operand:SF 2 "gpc_reg_operand" "")))]
+  "TARGET_HARD_FLOAT"
+  "")
+
+(define_insn ""
+  [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
+	(plus:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
+		 (match_operand:SF 2 "gpc_reg_operand" "f")))]
+  "TARGET_POWERPC && TARGET_HARD_FLOAT"
+  "fadds %0,%1,%2"
+  [(set_attr "type" "fp")])
+
+(define_insn ""
+  [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
+	(plus:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
+		 (match_operand:SF 2 "gpc_reg_operand" "f")))]
+  "! TARGET_POWERPC && TARGET_HARD_FLOAT"
+  "{fa|fadd} %0,%1,%2"
+  [(set_attr "type" "fp")])
+
+(define_expand "subsf3"
+  [(set (match_operand:SF 0 "gpc_reg_operand" "")
+	(minus:SF (match_operand:SF 1 "gpc_reg_operand" "")
+		  (match_operand:SF 2 "gpc_reg_operand" "")))]
+  "TARGET_HARD_FLOAT"
+  "")
+
+(define_insn ""
+  [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
+	(minus:SF (match_operand:SF 1 "gpc_reg_operand" "f")
+		  (match_operand:SF 2 "gpc_reg_operand" "f")))]
+  "TARGET_POWERPC && TARGET_HARD_FLOAT"
+  "fsubs %0,%1,%2"
+  [(set_attr "type" "fp")])
+
+(define_insn ""
+  [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
+	(minus:SF (match_operand:SF 1 "gpc_reg_operand" "f")
+		  (match_operand:SF 2 "gpc_reg_operand" "f")))]
+  "! TARGET_POWERPC && TARGET_HARD_FLOAT"
+  "{fs|fsub} %0,%1,%2"
+  [(set_attr "type" "fp")])
+
+(define_expand "mulsf3"
+  [(set (match_operand:SF 0 "gpc_reg_operand" "")
+	(mult:SF (match_operand:SF 1 "gpc_reg_operand" "")
+		 (match_operand:SF 2 "gpc_reg_operand" "")))]
+  "TARGET_HARD_FLOAT"
+  "")
+
+(define_insn ""
+  [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
+	(mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
+		 (match_operand:SF 2 "gpc_reg_operand" "f")))]
+  "TARGET_POWERPC && TARGET_HARD_FLOAT"
+  "fmuls %0,%1,%2"
+  [(set_attr "type" "fp")])
+
+(define_insn ""
+  [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
+	(mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
+		 (match_operand:SF 2 "gpc_reg_operand" "f")))]
+  "! TARGET_POWERPC && TARGET_HARD_FLOAT"
+  "{fm|fmul} %0,%1,%2"
+  [(set_attr "type" "dmul")])
+
+(define_expand "divsf3"
+  [(set (match_operand:SF 0 "gpc_reg_operand" "")
+	(div:SF (match_operand:SF 1 "gpc_reg_operand" "")
+		(match_operand:SF 2 "gpc_reg_operand" "")))]
+  "TARGET_HARD_FLOAT"
+  "")
+
+(define_insn ""
+  [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
+	(div:SF (match_operand:SF 1 "gpc_reg_operand" "f")
+		(match_operand:SF 2 "gpc_reg_operand" "f")))]
+  "TARGET_POWERPC && TARGET_HARD_FLOAT"
+  "fdivs %0,%1,%2"
+  [(set_attr "type" "sdiv")])
+
+(define_insn ""
+  [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
+	(div:SF (match_operand:SF 1 "gpc_reg_operand" "f")
+		(match_operand:SF 2 "gpc_reg_operand" "f")))]
+  "! TARGET_POWERPC && TARGET_HARD_FLOAT"
+  "{fd|fdiv} %0,%1,%2"
+  [(set_attr "type" "ddiv")])
+
+(define_insn ""
+  [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
+	(plus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
+			  (match_operand:SF 2 "gpc_reg_operand" "f"))
+		 (match_operand:SF 3 "gpc_reg_operand" "f")))]
+  "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
+  "fmadds %0,%1,%2,%3"
+  [(set_attr "type" "fp")])
+
+(define_insn ""
+  [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
+	(plus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
+			  (match_operand:SF 2 "gpc_reg_operand" "f"))
+		 (match_operand:SF 3 "gpc_reg_operand" "f")))]
+  "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
+  "{fma|fmadd} %0,%1,%2,%3"
+  [(set_attr "type" "dmul")])
+
+(define_insn ""
+  [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
+	(minus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
+			   (match_operand:SF 2 "gpc_reg_operand" "f"))
+		  (match_operand:SF 3 "gpc_reg_operand" "f")))]
+  "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
+  "fmsubs %0,%1,%2,%3"
+  [(set_attr "type" "fp")])
+
+(define_insn ""
+  [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
+	(minus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
+			   (match_operand:SF 2 "gpc_reg_operand" "f"))
+		  (match_operand:SF 3 "gpc_reg_operand" "f")))]
+  "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
+  "{fms|fmsub} %0,%1,%2,%3"
+  [(set_attr "type" "dmul")])
+
+(define_insn ""
+  [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
+	(neg:SF (plus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
+				  (match_operand:SF 2 "gpc_reg_operand" "f"))
+			 (match_operand:SF 3 "gpc_reg_operand" "f"))))]
+  "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
+  "fnmadds %0,%1,%2,%3"
+  [(set_attr "type" "fp")])
+
+(define_insn ""
+  [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
+	(neg:SF (plus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
+				  (match_operand:SF 2 "gpc_reg_operand" "f"))
+			 (match_operand:SF 3 "gpc_reg_operand" "f"))))]
+  "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
+  "{fnma|fnmadd} %0,%1,%2,%3"
+  [(set_attr "type" "dmul")])
+
+(define_insn ""
+  [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
+	(neg:SF (minus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
+				   (match_operand:SF 2 "gpc_reg_operand" "f"))
+			  (match_operand:SF 3 "gpc_reg_operand" "f"))))]
+  "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
+  "fnmsubs %0,%1,%2,%3"
+  [(set_attr "type" "fp")])
+
+(define_insn ""
+  [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
+	(neg:SF (minus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
+				   (match_operand:SF 2 "gpc_reg_operand" "f"))
+			  (match_operand:SF 3 "gpc_reg_operand" "f"))))]
+  "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
+  "{fnms|fnmsub} %0,%1,%2,%3"
+  [(set_attr "type" "dmul")])
+
+(define_expand "sqrtsf2"
+  [(set (match_operand:SF 0 "gpc_reg_operand" "")
+	(sqrt:SF (match_operand:SF 1 "gpc_reg_operand" "")))]
+  "(TARGET_PPC_GPOPT || TARGET_POWER2) && TARGET_HARD_FLOAT"
+  "")
+
+(define_insn ""
+  [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
+	(sqrt:SF (match_operand:SF 1 "gpc_reg_operand" "f")))]
+  "TARGET_PPC_GPOPT && TARGET_HARD_FLOAT"
+  "fsqrts %0,%1"
+  [(set_attr "type" "ssqrt")])
+
+(define_insn ""
+  [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
+	(sqrt:SF (match_operand:SF 1 "gpc_reg_operand" "f")))]
+  "TARGET_POWER2 && TARGET_HARD_FLOAT"
+  "fsqrt %0,%1"
+  [(set_attr "type" "dsqrt")])
+
+;; For MIN, MAX, and conditional move, we use DEFINE_EXPAND's that involve a
+;; fsel instruction and some auxiliary computations.  Then we just have a
+;; single DEFINE_INSN for fsel and the define_splits to make them if made by
+;; combine.
+(define_expand "maxsf3"
+  [(set (match_dup 3)
+	(minus:SF (match_operand:SF 1 "gpc_reg_operand" "")
+		  (match_operand:SF 2 "gpc_reg_operand" "")))
+   (set (match_operand:SF 0 "gpc_reg_operand" "")
+	(if_then_else:SF (ge (match_dup 3)
+			     (const_int 0))
+			 (match_dup 1)
+			 (match_dup 2)))]
+  "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
+  "
+{ operands[3] = gen_reg_rtx (SFmode); }")
+
+(define_split
+  [(set (match_operand:SF 0 "gpc_reg_operand" "")
+	(smax:SF (match_operand:SF 1 "gpc_reg_operand" "")
+		 (match_operand:SF 2 "gpc_reg_operand" "")))
+   (clobber (match_operand:SF 3 "gpc_reg_operand" ""))]
+  "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
+  [(set (match_dup 3)
+	(minus:SF (match_dup 1) (match_dup 2)))
+   (set (match_dup 0)
+	(if_then_else:SF (ge (match_dup 3)
+			     (const_int 0))
+			 (match_dup 1)
+			 (match_dup 2)))]
+  "")
+
+(define_expand "minsf3"
+  [(set (match_dup 3)
+	(minus:SF (match_operand:SF 2 "gpc_reg_operand" "")
+		  (match_operand:SF 1 "gpc_reg_operand" "")))
+   (set (match_operand:SF 0 "gpc_reg_operand" "")
+	(if_then_else:SF (ge (match_dup 3)
+			     (const_int 0))
+			 (match_dup 1)
+			 (match_dup 2)))]
+  "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
+  "
+{ operands[3] = gen_reg_rtx (SFmode); }")
+
+(define_split
+  [(set (match_operand:SF 0 "gpc_reg_operand" "")
+	(smin:SF (match_operand:SF 1 "gpc_reg_operand" "")
+		 (match_operand:SF 2 "gpc_reg_operand" "")))
+   (clobber (match_operand:SF 3 "gpc_reg_operand" ""))]
+  "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
+  [(set (match_dup 3)
+	(minus:SF (match_dup 2) (match_dup 1)))
+   (set (match_dup 0)
+	(if_then_else:SF (ge (match_dup 3)
+			     (const_int 0))
+			 (match_dup 1)
+			 (match_dup 2)))]
+  "")
+
+(define_expand "movsfcc"
+   [(set (match_operand:SF 0 "gpc_reg_operand" "")
+	 (if_then_else:SF (match_operand 1 "comparison_operator" "")
+			  (match_operand:SF 2 "gpc_reg_operand" "")
+			  (match_operand:SF 3 "gpc_reg_operand" "")))]
+  "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
+  "
+{
+  rtx temp, op0, op1;
+  enum rtx_code code = GET_CODE (operands[1]);
+  if (! rs6000_compare_fp_p)
+    FAIL;
+  switch (code)
+    {
+    case GE: case EQ: case NE:
+      op0 = rs6000_compare_op0;
+      op1 = rs6000_compare_op1;
+      break;
+    case GT:
+      op0 = rs6000_compare_op1;
+      op1 = rs6000_compare_op0;
+      temp = operands[2]; operands[2] = operands[3]; operands[3] = temp;
+      break;
+    case LE:
+      op0 = rs6000_compare_op1;
+      op1 = rs6000_compare_op0;
+      break;
+    case LT:
+      op0 = rs6000_compare_op0;
+      op1 = rs6000_compare_op1;
+      temp = operands[2]; operands[2] = operands[3]; operands[3] = temp;
+      break;
+    default:
+      FAIL;
+    }
+  if (GET_MODE (rs6000_compare_op0) == DFmode)
+    {
+      temp = gen_reg_rtx (DFmode);
+      emit_insn (gen_subdf3 (temp, op0, op1));
+      emit_insn (gen_fseldfsf4 (operands[0], temp, operands[2], operands[3]));
+      if (code == EQ)
+	{
+	  emit_insn (gen_negdf2 (temp, temp));
+	  emit_insn (gen_fseldfsf4 (operands[0], temp, operands[0], operands[3]));
+	}
+      else if (code == NE)
+	{
+	  emit_insn (gen_negdf2 (temp, temp));
+	  emit_insn (gen_fseldfsf4 (operands[0], temp, operands[3], operands[0]));
+	}
+    }
+  else
+    {
+      temp = gen_reg_rtx (SFmode);
+      emit_insn (gen_subsf3 (temp, op0, op1));
+      emit_insn (gen_fselsfsf4 (operands[0], temp, operands[2], operands[3]));
+      if (code == EQ)
+	{
+	  emit_insn (gen_negsf2 (temp, temp));
+	  emit_insn (gen_fselsfsf4 (operands[0], temp, operands[0], operands[3]));
+	}
+      else if (code == NE)
+	{
+	  emit_insn (gen_negsf2 (temp, temp));
+	  emit_insn (gen_fselsfsf4 (operands[0], temp, operands[3], operands[0]));
+	}
+    }
+  DONE;
+}")
+
+(define_insn "fselsfsf4"
+  [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
+	(if_then_else:SF (ge (match_operand:SF 1 "gpc_reg_operand" "f")
+			     (const_int 0))
+			 (match_operand:SF 2 "gpc_reg_operand" "f")
+			 (match_operand:SF 3 "gpc_reg_operand" "f")))]
+  "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
+  "fsel %0,%1,%2,%3"
+  [(set_attr "type" "fp")])
+
+(define_insn "fseldfsf4"
+  [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
+	(if_then_else:SF (ge (match_operand:DF 1 "gpc_reg_operand" "f")
+			     (const_int 0))
+			 (match_operand:SF 2 "gpc_reg_operand" "f")
+			 (match_operand:SF 3 "gpc_reg_operand" "f")))]
+  "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
+  "fsel %0,%1,%2,%3"
+  [(set_attr "type" "fp")])
+
+(define_insn "negdf2"
+  [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
+	(neg:DF (match_operand:DF 1 "gpc_reg_operand" "f")))]
+  "TARGET_HARD_FLOAT"
+  "fneg %0,%1"
+  [(set_attr "type" "fp")])
+
+(define_insn "absdf2"
+  [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
+	(abs:DF (match_operand:DF 1 "gpc_reg_operand" "f")))]
+  "TARGET_HARD_FLOAT"
+  "fabs %0,%1"
+  [(set_attr "type" "fp")])
+
+(define_insn ""
+  [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
+	(neg:DF (abs:DF (match_operand:DF 1 "gpc_reg_operand" "f"))))]
+  "TARGET_HARD_FLOAT"
+  "fnabs %0,%1"
+  [(set_attr "type" "fp")])
+
+(define_insn "adddf3"
+  [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
+	(plus:DF (match_operand:DF 1 "gpc_reg_operand" "%f")
+		 (match_operand:DF 2 "gpc_reg_operand" "f")))]
+  "TARGET_HARD_FLOAT"
+  "{fa|fadd} %0,%1,%2"
+  [(set_attr "type" "fp")])
+
+(define_insn "subdf3"
+  [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
+	(minus:DF (match_operand:DF 1 "gpc_reg_operand" "f")
+		  (match_operand:DF 2 "gpc_reg_operand" "f")))]
+  "TARGET_HARD_FLOAT"
+  "{fs|fsub} %0,%1,%2"
+  [(set_attr "type" "fp")])
+
+(define_insn "muldf3"
+  [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
+	(mult:DF (match_operand:DF 1 "gpc_reg_operand" "%f")
+		 (match_operand:DF 2 "gpc_reg_operand" "f")))]
+  "TARGET_HARD_FLOAT"
+  "{fm|fmul} %0,%1,%2"
+  [(set_attr "type" "dmul")])
+
+(define_insn "divdf3"
+  [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
+	(div:DF (match_operand:DF 1 "gpc_reg_operand" "f")
+		(match_operand:DF 2 "gpc_reg_operand" "f")))]
+  "TARGET_HARD_FLOAT"
+  "{fd|fdiv} %0,%1,%2"
+  [(set_attr "type" "ddiv")])
+
+(define_insn ""
+  [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
+	(plus:DF (mult:DF (match_operand:DF 1 "gpc_reg_operand" "%f")
+			  (match_operand:DF 2 "gpc_reg_operand" "f"))
+		 (match_operand:DF 3 "gpc_reg_operand" "f")))]
+  "TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
+  "{fma|fmadd} %0,%1,%2,%3"
+  [(set_attr "type" "dmul")])
+
+(define_insn ""
+  [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
+	(minus:DF (mult:DF (match_operand:DF 1 "gpc_reg_operand" "%f")
+			   (match_operand:DF 2 "gpc_reg_operand" "f"))
+		  (match_operand:DF 3 "gpc_reg_operand" "f")))]
+  "TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
+  "{fms|fmsub} %0,%1,%2,%3"
+  [(set_attr "type" "dmul")])
+
+(define_insn ""
+  [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
+	(neg:DF (plus:DF (mult:DF (match_operand:DF 1 "gpc_reg_operand" "%f")
+				  (match_operand:DF 2 "gpc_reg_operand" "f"))
+			 (match_operand:DF 3 "gpc_reg_operand" "f"))))]
+  "TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
+  "{fnma|fnmadd} %0,%1,%2,%3"
+  [(set_attr "type" "dmul")])
+
+(define_insn ""
+  [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
+	(neg:DF (minus:DF (mult:DF (match_operand:DF 1 "gpc_reg_operand" "%f")
+				   (match_operand:DF 2 "gpc_reg_operand" "f"))
+			  (match_operand:DF 3 "gpc_reg_operand" "f"))))]
+  "TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
+  "{fnms|fnmsub} %0,%1,%2,%3"
+  [(set_attr "type" "dmul")])
+
+(define_insn "sqrtdf2"
+  [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
+	(sqrt:DF (match_operand:DF 1 "gpc_reg_operand" "f")))]
+  "(TARGET_PPC_GPOPT || TARGET_POWER2) && TARGET_HARD_FLOAT"
+  "fsqrt %0,%1"
+  [(set_attr "type" "dsqrt")])
+
+;; For MIN, MAX, and conditional move, we use DEFINE_EXPAND's that involve a
+;; fsel instruction and some auxiliary computations.  Then we just have a
+;; single DEFINE_INSN for fsel and the define_splits to make them if made by
+;; combine.
+
+(define_expand "maxdf3"
+  [(set (match_dup 3)
+	(minus:DF (match_operand:DF 1 "gpc_reg_operand" "")
+		  (match_operand:DF 2 "gpc_reg_operand" "")))
+   (set (match_operand:DF 0 "gpc_reg_operand" "")
+	(if_then_else:DF (ge (match_dup 3)
+			     (const_int 0))
+			 (match_dup 1)
+			 (match_dup 2)))]
+  "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
+  "
+{ operands[3] = gen_reg_rtx (DFmode); }")
+
+(define_split
+  [(set (match_operand:DF 0 "gpc_reg_operand" "")
+	(smax:DF (match_operand:DF 1 "gpc_reg_operand" "")
+		 (match_operand:DF 2 "gpc_reg_operand" "")))
+   (clobber (match_operand:DF 3 "gpc_reg_operand" ""))]
+  "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
+  [(set (match_dup 3)
+	(minus:DF (match_dup 1) (match_dup 2)))
+   (set (match_dup 0)
+	(if_then_else:DF (ge (match_dup 3)
+			     (const_int 0))
+			 (match_dup 1)
+			 (match_dup 2)))]
+  "")
+
+(define_expand "mindf3"
+  [(set (match_dup 3)
+	(minus:DF (match_operand:DF 2 "gpc_reg_operand" "")
+		  (match_operand:DF 1 "gpc_reg_operand" "")))
+   (set (match_operand:DF 0 "gpc_reg_operand" "")
+	(if_then_else:DF (ge (match_dup 3)
+			     (const_int 0))
+			 (match_dup 1)
+			 (match_dup 2)))]
+  "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
+  "
+{ operands[3] = gen_reg_rtx (DFmode); }")
+
+(define_split
+  [(set (match_operand:DF 0 "gpc_reg_operand" "")
+	(smin:DF (match_operand:DF 1 "gpc_reg_operand" "")
+		 (match_operand:DF 2 "gpc_reg_operand" "")))
+   (clobber (match_operand:DF 3 "gpc_reg_operand" ""))]
+  "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
+  [(set (match_dup 3)
+	(minus:DF (match_dup 2) (match_dup 1)))
+   (set (match_dup 0)
+	(if_then_else:DF (ge (match_dup 3)
+			     (const_int 0))
+			 (match_dup 1)
+			 (match_dup 2)))]
+  "")
+
+(define_expand "movdfcc"
+   [(set (match_operand:DF 0 "gpc_reg_operand" "")
+	 (if_then_else:DF (match_operand 1 "comparison_operator" "")
+			  (match_operand:DF 2 "gpc_reg_operand" "")
+			  (match_operand:DF 3 "gpc_reg_operand" "")))]
+  "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
+  "
+{
+  rtx temp, op0, op1;
+  enum rtx_code code = GET_CODE (operands[1]);
+  if (! rs6000_compare_fp_p)
+    FAIL;
+  switch (code)
+    {
+    case GE: case EQ: case NE:
+      op0 = rs6000_compare_op0;
+      op1 = rs6000_compare_op1;
+      break;
+    case GT:
+      op0 = rs6000_compare_op1;
+      op1 = rs6000_compare_op0;
+      temp = operands[2]; operands[2] = operands[3]; operands[3] = temp;
+      break;
+    case LE:
+      op0 = rs6000_compare_op1;
+      op1 = rs6000_compare_op0;
+      break;
+    case LT:
+      op0 = rs6000_compare_op0;
+      op1 = rs6000_compare_op1;
+      temp = operands[2]; operands[2] = operands[3]; operands[3] = temp;
+      break;
+    default:
+      FAIL;
+    }
+  if (GET_MODE (rs6000_compare_op0) == DFmode)
+    {
+      temp = gen_reg_rtx (DFmode);
+      emit_insn (gen_subdf3 (temp, op0, op1));
+      emit_insn (gen_fseldfdf4 (operands[0], temp, operands[2], operands[3]));
+      if (code == EQ)
+	{
+	  emit_insn (gen_negdf2 (temp, temp));
+	  emit_insn (gen_fseldfdf4 (operands[0], temp, operands[0], operands[3]));
+	}
+      else if (code == NE)
+	{
+	  emit_insn (gen_negdf2 (temp, temp));
+	  emit_insn (gen_fseldfdf4 (operands[0], temp, operands[3], operands[0]));
+	}
+    }
+  else
+    {
+      temp = gen_reg_rtx (SFmode);
+      emit_insn (gen_subsf3 (temp, op0, op1));
+      emit_insn (gen_fselsfdf4 (operands[0], temp, operands[2], operands[3]));
+      if (code == EQ)
+	{
+	  emit_insn (gen_negsf2 (temp, temp));
+	  emit_insn (gen_fselsfdf4 (operands[0], temp, operands[0], operands[3]));
+	}
+      else if (code == NE)
+	{
+	  emit_insn (gen_negsf2 (temp, temp));
+	  emit_insn (gen_fselsfdf4 (operands[0], temp, operands[3], operands[0]));
+	}
+    }
+  DONE;
+}")
+
+(define_insn "fseldfdf4"
+  [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
+	(if_then_else:DF (ge (match_operand:DF 1 "gpc_reg_operand" "f")
+			     (const_int 0))
+			 (match_operand:DF 2 "gpc_reg_operand" "f")
+			 (match_operand:DF 3 "gpc_reg_operand" "f")))]
+  "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
+  "fsel %0,%1,%2,%3"
+  [(set_attr "type" "fp")])
+
+(define_insn "fselsfdf4"
+  [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
+	(if_then_else:DF (ge (match_operand:SF 1 "gpc_reg_operand" "f")
+			     (const_int 0))
+			 (match_operand:DF 2 "gpc_reg_operand" "f")
+			 (match_operand:DF 3 "gpc_reg_operand" "f")))]
+  "TARGET_PPC_GFXOPT"
+  "fsel %0,%1,%2,%3"
+  [(set_attr "type" "fp")])
+
+;; Conversions to and from floating-point.
+
+(define_expand "floatsidf2"
+  [(parallel [(set (match_operand:DF 0 "gpc_reg_operand" "")
+		   (float:DF (match_operand:SI 1 "gpc_reg_operand" "")))
+	      (use (match_dup 2))
+	      (use (match_dup 3))
+	      (clobber (match_dup 4))
+	      (clobber (match_dup 5))
+	      (clobber (reg:DF 76))])]
+  "! TARGET_POWERPC64 && TARGET_HARD_FLOAT"
+  "
+{
+  operands[2] = force_reg (SImode, GEN_INT (0x43300000));
+  operands[3] = force_reg (DFmode, rs6000_float_const (\"4503601774854144\", DFmode));
+  operands[4] = gen_reg_rtx (SImode);
+  operands[5] = gen_reg_rtx (Pmode);
+}")
+
+(define_insn "*floatsidf2_internal"
+  [(set (match_operand:DF 0 "gpc_reg_operand" "=&f")
+	(float:DF (match_operand:SI 1 "gpc_reg_operand" "r")))
+   (use (match_operand:SI 2 "gpc_reg_operand" "r"))
+   (use (match_operand:DF 3 "gpc_reg_operand" "f"))
+   (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
+   (clobber (match_operand 5 "gpc_reg_operand" "=b"))
+   (clobber (reg:DF 76))]
+  "! TARGET_POWERPC64 && TARGET_HARD_FLOAT"
+  "#"
+  [(set_attr "length" "24")])
+
+(define_split
+  [(set (match_operand:DF 0 "gpc_reg_operand" "")
+	(float:DF (match_operand:SI 1 "gpc_reg_operand" "")))
+   (use (match_operand:SI 2 "gpc_reg_operand" ""))
+   (use (match_operand:DF 3 "gpc_reg_operand" ""))
+   (clobber (match_operand:SI 4 "gpc_reg_operand" ""))
+   (clobber (match_operand 5 "gpc_reg_operand" ""))
+   (clobber (reg:DF 76))]
+  "! TARGET_POWERPC64 && TARGET_HARD_FLOAT"
+  [(set (match_dup 4)
+	(xor:SI (match_dup 1)
+		(match_dup 6)))
+   (set (match_dup 5)
+	(unspec [(const_int 0)] 11))
+   (set (match_dup 7)
+	(unspec [(match_dup 4)
+		 (match_dup 5)] 12))	;; low word
+   (set (match_dup 7)
+	(unspec [(match_dup 2)
+		 (match_dup 5)
+		 (match_dup 7)] 13))	;; high word
+   (set (match_dup 0)
+	(unspec [(match_dup 7)
+		 (match_dup 5)] 14))
+   (set (match_dup 0)
+	(minus:DF (match_dup 0)
+		  (match_dup 3)))]
+  "
+{
+  operands[6] = GEN_INT (0x80000000);
+  operands[7] = gen_rtx_REG (DFmode, FPMEM_REGNUM);
+}")
+
+(define_expand "floatunssidf2"
+  [(parallel [(set (match_operand:DF 0 "gpc_reg_operand" "")
+		   (unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" "")))
+	      (use (match_dup 2))
+	      (use (match_dup 3))
+	      (clobber (match_dup 4))
+	      (clobber (reg:DF 76))])]
+  "! TARGET_POWERPC64 && TARGET_HARD_FLOAT"
+  "
+{
+  operands[2] = force_reg (SImode, GEN_INT (0x43300000));
+  operands[3] = force_reg (DFmode, rs6000_float_const (\"4503599627370496\", DFmode));
+  operands[4] = gen_reg_rtx (Pmode);
+}")
+
+(define_insn "*floatunssidf2_internal"
+  [(set (match_operand:DF 0 "gpc_reg_operand" "=&f")
+	(unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" "r")))
+   (use (match_operand:SI 2 "gpc_reg_operand" "r"))
+   (use (match_operand:DF 3 "gpc_reg_operand" "f"))
+   (clobber (match_operand 4 "gpc_reg_operand" "=b"))
+   (clobber (reg:DF 76))]
+  "! TARGET_POWERPC64 && TARGET_HARD_FLOAT"
+  "#"
+  [(set_attr "length" "20")])
+
+(define_split
+  [(set (match_operand:DF 0 "gpc_reg_operand" "")
+	(unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" "")))
+   (use (match_operand:SI 2 "gpc_reg_operand" ""))
+   (use (match_operand:DF 3 "gpc_reg_operand" ""))
+   (clobber (match_operand 4 "gpc_reg_operand" ""))
+   (clobber (reg:DF 76))]
+  "! TARGET_POWERPC64 && TARGET_HARD_FLOAT"
+  [(set (match_dup 4)
+	(unspec [(const_int 0)] 11))
+   (set (match_dup 5)
+	(unspec [(match_dup 1)
+		 (match_dup 4)] 12))	;; low word
+   (set (match_dup 5)
+	(unspec [(match_dup 2)
+		 (match_dup 4)
+		 (match_dup 5)] 13))	;; high word
+   (set (match_dup 0)
+	(unspec [(match_dup 5)
+		 (match_dup 4)] 14))
+   (set (match_dup 0)
+	(minus:DF (match_dup 0)
+		  (match_dup 3)))]
+  "operands[5] = gen_rtx_REG (DFmode, FPMEM_REGNUM);")
+
+;; Load up scratch register with base address + offset if needed
+(define_insn "*floatsidf2_loadaddr"
+  [(set (match_operand 0 "gpc_reg_operand" "=b")
+	(unspec [(const_int 0)] 11))]
+  "TARGET_HARD_FLOAT"
+  "*
+{
+  if (rs6000_fpmem_offset > 32760)
+    {
+      rtx xop[3];
+
+      xop[0] = operands[0];
+      xop[1] = (frame_pointer_needed) ? frame_pointer_rtx : stack_pointer_rtx;
+      xop[2] = GEN_INT ((rs6000_fpmem_offset >> 16) + ((rs6000_fpmem_offset & 0x8000) >> 15));
+      output_asm_insn (\"{cau|addis} %0,%1,%2\", xop);
+    }
+
+  return \"\";
+}"
+  [(set_attr "length" "4")])
+
+(define_insn "*floatsidf2_store1"
+  [(set (reg:DF 76)
+	(unspec [(match_operand:SI 0 "gpc_reg_operand" "r")
+		 (match_operand 1 "gpc_reg_operand" "b")] 12))]
+  "TARGET_HARD_FLOAT"
+  "*
+{
+  rtx indx;
+
+  if (rs6000_fpmem_offset > 32760)
+    indx = operands[1];
+  else if (frame_pointer_needed)
+    indx = frame_pointer_rtx;
+  else
+    indx = stack_pointer_rtx;
+
+  operands[2] = gen_rtx_MEM (SImode,
+			 gen_rtx_PLUS (Pmode,
+				  indx,
+				  GEN_INT ((((rs6000_fpmem_offset & 0xffff) ^ 0x8000) - 0x8000)
+					   + ((WORDS_BIG_ENDIAN != 0) * 4))));
+
+  return \"{st|stw} %0,%2\";
+}"
+  [(set_attr "type" "store")])
+
+(define_insn "*floatsidf2_store2"
+  [(set (reg:DF 76)
+	(unspec [(match_operand:SI 0 "gpc_reg_operand" "r")
+		 (match_operand 1 "gpc_reg_operand" "b")
+		 (reg:DF 76)] 13))]
+  "TARGET_HARD_FLOAT"
+  "*
+{
+  rtx indx;
+
+  if (rs6000_fpmem_offset > 32760)
+    indx = operands[1];
+  else if (frame_pointer_needed)
+    indx = frame_pointer_rtx;
+  else
+    indx = stack_pointer_rtx;
+
+  operands[2] = gen_rtx_MEM (SImode,
+			 gen_rtx_PLUS (Pmode,
+				  indx,
+				  GEN_INT ((((rs6000_fpmem_offset & 0xffff) ^ 0x8000) - 0x8000)
+					   + ((WORDS_BIG_ENDIAN == 0) * 4))));
+
+  return \"{st|stw} %0,%2\";
+}"
+  [(set_attr "type" "store")])
+
+(define_insn "*floatsidf2_load"
+  [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
+	(unspec [(reg:DF 76)
+		 (match_operand 1 "gpc_reg_operand" "b")] 14))]
+  "TARGET_HARD_FLOAT"
+  "*
+{
+  rtx indx;
+  HOST_WIDE_INT offset = rs6000_fpmem_offset;
+
+  if (rs6000_fpmem_offset > 32760)
+    {
+      indx = operands[1];
+      offset = (((offset & 0xffff) ^ 0x8000) - 0x8000);
+    }
+  else if (frame_pointer_needed)
+    indx = frame_pointer_rtx;
+  else
+    indx = stack_pointer_rtx;
+
+  operands[2] = gen_rtx_MEM (SImode,
+			 gen_rtx_PLUS (Pmode, indx, GEN_INT (offset)));
+
+  return \"lfd %0,%2\";
+}"
+  [(set_attr "type" "fpload")])
+
+(define_expand "fix_truncdfsi2"
+  [(parallel [(set (match_operand:SI 0 "gpc_reg_operand" "")
+		   (fix:SI (match_operand:DF 1 "gpc_reg_operand" "")))
+	      (clobber (match_dup 2))
+	      (clobber (match_dup 3))
+	      (clobber (match_dup 4))])]
+  "TARGET_HARD_FLOAT"
+  "
+{
+  if (! TARGET_POWER2 && ! TARGET_POWERPC)
+    {
+      emit_insn (gen_trunc_call (operands[0], operands[1],
+				 gen_rtx_SYMBOL_REF (Pmode, RS6000_ITRUNC)));
+      DONE;
+    }
+
+  operands[2] = gen_reg_rtx (DImode);
+  operands[3] = gen_reg_rtx (Pmode);
+  operands[4] = gen_rtx_REG (DImode, FPMEM_REGNUM);
+}")
+
+(define_insn "*fix_truncdfsi2_internal"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(fix:SI (match_operand:DF 1 "gpc_reg_operand" "f")))
+   (clobber (match_operand:DI 2 "gpc_reg_operand" "=f"))
+   (clobber (match_operand 3 "gpc_reg_operand" "=b"))
+   (clobber (reg:DI 76))]
+  "TARGET_HARD_FLOAT"
+  "#"
+  [(set_attr "length" "12")])
+
+(define_split
+  [(set (match_operand:SI 0 "gpc_reg_operand" "")
+	(fix:SI (match_operand:DF 1 "gpc_reg_operand" "f")))
+   (clobber (match_operand:DI 2 "gpc_reg_operand" ""))
+   (clobber (match_operand 3 "gpc_reg_operand" ""))
+   (clobber (reg:DI 76))]
+  "TARGET_HARD_FLOAT"
+  [(clobber (match_dup 2))
+   (set (subreg:SI (match_dup 2) 0)
+	(fix:SI (match_operand:DF 1 "gpc_reg_operand" "")))
+   (set (match_dup 3)
+	(unspec [(const_int 0)] 11))
+   (set (match_dup 4)
+	(unspec [(match_dup 2)
+		 (match_dup 3)] 15))
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(unspec [(match_dup 4)
+		 (match_dup 3)] 16))]
+  "operands[4] = gen_rtx_REG (DImode, FPMEM_REGNUM);")
+
+(define_insn "*fix_truncdfsi2_store"
+  [(set (reg:DI 76)
+	(unspec [(match_operand:DI 0 "gpc_reg_operand" "f")
+		 (match_operand 1 "gpc_reg_operand" "b")] 15))]
+  "(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT"
+  "*
+{
+  rtx indx;
+
+  if (rs6000_fpmem_offset > 32760)
+    indx = operands[1];
+  else if (frame_pointer_needed)
+    indx = frame_pointer_rtx;
+  else
+    indx = stack_pointer_rtx;
+
+  operands[2] = gen_rtx_MEM (DFmode,
+			 gen_rtx_PLUS (Pmode,
+				  indx,
+				  GEN_INT ((((rs6000_fpmem_offset & 0xffff)
+					     ^ 0x8000) - 0x8000))));
+
+  return \"stfd %0,%2\";
+}"
+  [(set_attr "type" "fpstore")])
+
+(define_insn "*fix_truncdfsi2_load"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(unspec [(reg:DI 76)
+		 (match_operand 1 "gpc_reg_operand" "b")] 16))]
+  "(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT"
+  "*
+{
+  rtx indx;
+
+  if (rs6000_fpmem_offset > 32760)
+    indx = operands[1];
+  else if (frame_pointer_needed)
+    indx = frame_pointer_rtx;
+  else
+    indx = stack_pointer_rtx;
+
+  operands[2] = gen_rtx_MEM (DFmode,
+			 gen_rtx_PLUS (Pmode,
+				  indx,
+				  GEN_INT ((((rs6000_fpmem_offset & 0xffff) ^ 0x8000) - 0x8000)
+					   + ((WORDS_BIG_ENDIAN) ? 4 : 0))));
+
+  return \"{l|lwz} %0,%2\";
+}"
+  [(set_attr "type" "load")])
+
+(define_expand "fixuns_truncdfsi2"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "")
+	(unsigned_fix:SI (match_operand:DF 1 "gpc_reg_operand" "")))]
+  "! TARGET_POWER2 && ! TARGET_POWERPC && TARGET_HARD_FLOAT"
+  "
+{
+  emit_insn (gen_trunc_call (operands[0], operands[1],
+			     gen_rtx_SYMBOL_REF (Pmode, RS6000_UITRUNC)));
+  DONE;
+}")
+
+(define_expand "trunc_call"
+  [(parallel [(set (match_operand:SI 0 "" "")
+		   (fix:SI (match_operand:DF 1 "" "")))
+	      (use (match_operand:SI 2 "" ""))])]
+  "TARGET_HARD_FLOAT"
+  "
+{
+  rtx insns = gen_trunc_call_rtl (operands[0], operands[1], operands[2]);
+  rtx first = XVECEXP (insns, 0, 0);
+  rtx last = XVECEXP (insns, 0, XVECLEN (insns, 0) - 1);
+
+  REG_NOTES (first) = gen_rtx_INSN_LIST (REG_LIBCALL, last,
+			       REG_NOTES (first));
+  REG_NOTES (last) = gen_rtx_INSN_LIST (REG_RETVAL, first, REG_NOTES (last));
+
+  emit_insn (insns);
+  DONE;
+}")
+
+(define_expand "trunc_call_rtl"
+  [(set (reg:DF 33) (match_operand:DF 1 "gpc_reg_operand" ""))
+   (use (reg:DF 33))
+   (parallel [(set (reg:SI 3)
+		   (call (mem:SI (match_operand 2 "" "")) (const_int 0)))
+	      (use (const_int 0))
+	      (clobber (scratch:SI))])
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(reg:SI 3))]
+  "TARGET_HARD_FLOAT"
+  "
+{
+  rs6000_trunc_used = 1;
+}")
+
+(define_insn "*fctiwz"
+  [(set (subreg:SI (match_operand:DI 0 "gpc_reg_operand" "=f") 0)
+	(fix:SI (match_operand:DF 1 "gpc_reg_operand" "f")))]
+  "(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT"
+  "{fcirz|fctiwz} %0,%1"
+  [(set_attr "type" "fp")])
+
+(define_insn "floatdidf2"
+  [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
+	(float:DF (match_operand:DI 1 "gpc_reg_operand" "f")))]
+  "TARGET_POWERPC64 && TARGET_HARD_FLOAT"
+  "fcfid %0,%1"
+  [(set_attr "type" "fp")])
+
+(define_insn "fix_truncdfdi2"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=f")
+	(fix:DI (match_operand:DF 1 "gpc_reg_operand" "f")))]
+  "TARGET_POWERPC64 && TARGET_HARD_FLOAT"
+  "fctidz %0,%1"
+  [(set_attr "type" "fp")])
+
+;; Define the DImode operations that can be done in a small number
+;; of instructions.  The & constraints are to prevent the register
+;; allocator from allocating registers that overlap with the inputs
+;; (for example, having an input in 7,8 and an output in 6,7).  We
+;; also allow for the output being the same as one of the inputs.
+
+(define_insn "*adddi3_noppc64"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,&r,r,r")
+	(plus:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,0,0")
+		 (match_operand:DI 2 "reg_or_short_operand" "r,I,r,I")))]
+  "! TARGET_POWERPC64"
+  "*
+{
+  if (WORDS_BIG_ENDIAN)
+    return (GET_CODE (operands[2])) != CONST_INT
+	    ? \"{a|addc} %L0,%L1,%L2\;{ae|adde} %0,%1,%2\"
+	    : \"{ai|addic} %L0,%L1,%2\;{a%G2e|add%G2e} %0,%1\";
+  else
+    return (GET_CODE (operands[2])) != CONST_INT
+	    ? \"{a|addc} %0,%1,%2\;{ae|adde} %L0,%L1,%L2\"
+	    : \"{ai|addic} %0,%1,%2\;{a%G2e|add%G2e} %L0,%L1\";
+}"
+  [(set_attr "length" "8")])
+
+(define_insn "*subdi3_noppc64"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,&r,r,r,r")
+	(minus:DI (match_operand:DI 1 "reg_or_short_operand" "r,I,0,r,I")
+		  (match_operand:DI 2 "gpc_reg_operand" "r,r,r,0,0")))]
+  "! TARGET_POWERPC64"
+  "*
+{
+  if (WORDS_BIG_ENDIAN)
+    return (GET_CODE (operands[1]) != CONST_INT)
+	    ? \"{sf|subfc} %L0,%L2,%L1\;{sfe|subfe} %0,%2,%1\"
+	    : \"{sfi|subfic} %L0,%L2,%1\;{sf%G1e|subf%G1e} %0,%2\";
+  else
+    return (GET_CODE (operands[1]) != CONST_INT)
+	    ? \"{sf|subfc} %0,%2,%1\;{sfe|subfe} %L0,%L2,%L1\"
+	    : \"{sfi|subfic} %0,%2,%1\;{sf%G1e|subf%G1e} %L0,%L2\";
+}"
+  [(set_attr "length" "8")])
+
+(define_insn "*negdi2_noppc64"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,r")
+	(neg:DI (match_operand:DI 1 "gpc_reg_operand" "r,0")))]
+  "! TARGET_POWERPC64"
+  "*
+{
+  return (WORDS_BIG_ENDIAN)
+    ? \"{sfi|subfic} %L0,%L1,0\;{sfze|subfze} %0,%1\"
+    : \"{sfi|subfic} %0,%1,0\;{sfze|subfze} %L0,%L1\";
+}"
+  [(set_attr "length" "8")])
+
+(define_expand "mulsidi3"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+	(mult:DI (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" ""))
+		 (sign_extend:DI (match_operand:SI 2 "gpc_reg_operand" ""))))]
+  "! TARGET_POWERPC64"
+  "
+{
+  if (! TARGET_POWER && ! TARGET_POWERPC)
+    {
+      emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
+      emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
+      emit_insn (gen_mull_call ());
+      if (WORDS_BIG_ENDIAN)
+        emit_move_insn (operands[0], gen_rtx_REG (DImode, 3));
+      else
+	{
+	  emit_move_insn (operand_subword (operands[0], 0, 0, DImode),
+			  gen_rtx_REG (SImode, 3));
+	  emit_move_insn (operand_subword (operands[0], 1, 0, DImode),
+			  gen_rtx_REG (SImode, 4));
+	}
+      DONE;
+    }
+  else if (TARGET_POWER)
+    {
+      emit_insn (gen_mulsidi3_mq (operands[0], operands[1], operands[2]));
+      DONE;
+    }
+}")
+
+(define_insn "mulsidi3_mq"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(mult:DI (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" "%r"))
+		 (sign_extend:DI (match_operand:SI 2 "gpc_reg_operand" "r"))))
+   (clobber (match_scratch:SI 3 "=q"))]
+  "TARGET_POWER"
+  "mul %0,%1,%2\;mfmq %L0"
+  [(set_attr "type" "imul")
+   (set_attr "length" "8")])
+
+(define_insn "*mulsidi3_no_mq"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=&r")
+	(mult:DI (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" "%r"))
+		 (sign_extend:DI (match_operand:SI 2 "gpc_reg_operand" "r"))))]
+  "TARGET_POWERPC && ! TARGET_POWER && ! TARGET_POWERPC64"
+  "*
+{
+  return (WORDS_BIG_ENDIAN)
+    ? \"mulhw %0,%1,%2\;mullw %L0,%1,%2\"
+    : \"mulhw %L0,%1,%2\;mullw %0,%1,%2\";
+}"
+  [(set_attr "type" "imul")
+   (set_attr "length" "8")])
+
+(define_split
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+	(mult:DI (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" ""))
+		 (sign_extend:DI (match_operand:SI 2 "gpc_reg_operand" ""))))]
+  "TARGET_POWERPC && ! TARGET_POWERPC64 && reload_completed"
+  [(set (match_dup 3)
+	(truncate:SI
+	 (lshiftrt:DI (mult:DI (sign_extend:DI (match_dup 1))
+			       (sign_extend:DI (match_dup 2)))
+		      (const_int 32))))
+   (set (match_dup 4)
+	(mult:SI (match_dup 1)
+		 (match_dup 2)))]
+  "
+{
+  int endian = (WORDS_BIG_ENDIAN == 0);
+  operands[3] = operand_subword (operands[0], endian, 0, DImode);
+  operands[4] = operand_subword (operands[0], 1 - endian, 0, DImode);
+}")
+
+(define_expand "umulsidi3"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+	(mult:DI (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" ""))
+		 (zero_extend:DI (match_operand:SI 2 "gpc_reg_operand" ""))))]
+  "TARGET_POWERPC && ! TARGET_POWERPC64"
+  "
+{
+  if (TARGET_POWER)
+    {
+      emit_insn (gen_umulsidi3_mq (operands[0], operands[1], operands[2]));
+      DONE;
+    }
+}")
+
+(define_insn "umulsidi3_mq"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=&r")
+	(mult:DI (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "%r"))
+		 (zero_extend:DI (match_operand:SI 2 "gpc_reg_operand" "r"))))
+   (clobber (match_scratch:SI 3 "=q"))]
+  "TARGET_POWERPC && TARGET_POWER"
+  "*
+{
+  return (WORDS_BIG_ENDIAN)
+    ? \"mulhwu %0,%1,%2\;mullw %L0,%1,%2\"
+    : \"mulhwu %L0,%1,%2\;mullw %0,%1,%2\";
+}"
+  [(set_attr "type" "imul")
+   (set_attr "length" "8")])
+
+(define_insn "*umulsidi3_no_mq"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=&r")
+	(mult:DI (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "%r"))
+		 (zero_extend:DI (match_operand:SI 2 "gpc_reg_operand" "r"))))]
+  "TARGET_POWERPC && ! TARGET_POWER && ! TARGET_POWERPC64"
+  "*
+{
+  return (WORDS_BIG_ENDIAN)
+    ? \"mulhwu %0,%1,%2\;mullw %L0,%1,%2\"
+    : \"mulhwu %L0,%1,%2\;mullw %0,%1,%2\";
+}"
+  [(set_attr "type" "imul")
+   (set_attr "length" "8")])
+
+(define_split
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+	(mult:DI (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" ""))
+		 (zero_extend:DI (match_operand:SI 2 "gpc_reg_operand" ""))))]
+  "TARGET_POWERPC && ! TARGET_POWERPC64 && reload_completed"
+  [(set (match_dup 3)
+	(truncate:SI
+	 (lshiftrt:DI (mult:DI (zero_extend:DI (match_dup 1))
+			       (zero_extend:DI (match_dup 2)))
+		      (const_int 32))))
+   (set (match_dup 4)
+	(mult:SI (match_dup 1)
+		 (match_dup 2)))]
+  "
+{
+  int endian = (WORDS_BIG_ENDIAN == 0);
+  operands[3] = operand_subword (operands[0], endian, 0, DImode);
+  operands[4] = operand_subword (operands[0], 1 - endian, 0, DImode);
+}")
+
+(define_expand "smulsi3_highpart"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "")
+	(truncate:SI
+	 (lshiftrt:DI (mult:DI (sign_extend:DI
+				(match_operand:SI 1 "gpc_reg_operand" "%r"))
+			       (sign_extend:DI
+				(match_operand:SI 2 "gpc_reg_operand" "r")))
+		      (const_int 32))))]
+  ""
+  "
+{
+  if (! TARGET_POWER && ! TARGET_POWERPC)
+    {
+      emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
+      emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
+      emit_insn (gen_mulh_call ());
+      emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
+      DONE;
+    }
+  else if (TARGET_POWER)
+    {
+      emit_insn (gen_smulsi3_highpart_mq (operands[0], operands[1], operands[2]));
+      DONE;
+    }
+}")
+
+(define_insn "smulsi3_highpart_mq"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(truncate:SI
+	 (lshiftrt:DI (mult:DI (sign_extend:DI
+				(match_operand:SI 1 "gpc_reg_operand" "%r"))
+			       (sign_extend:DI
+				(match_operand:SI 2 "gpc_reg_operand" "r")))
+		      (const_int 32))))
+   (clobber (match_scratch:SI 3 "=q"))]
+  "TARGET_POWER"
+  "mul %0,%1,%2"
+  [(set_attr "type" "imul")])
+
+(define_insn "*smulsi3_highpart_no_mq"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(truncate:SI
+	 (lshiftrt:DI (mult:DI (sign_extend:DI
+				(match_operand:SI 1 "gpc_reg_operand" "%r"))
+			       (sign_extend:DI
+				(match_operand:SI 2 "gpc_reg_operand" "r")))
+		      (const_int 32))))]
+  "TARGET_POWERPC && ! TARGET_POWER"
+  "mulhw %0,%1,%2"
+  [(set_attr "type" "imul")])
+
+(define_expand "umulsi3_highpart"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "")
+	(truncate:SI
+	 (lshiftrt:DI (mult:DI (zero_extend:DI
+				(match_operand:SI 1 "gpc_reg_operand" ""))
+			       (zero_extend:DI
+				(match_operand:SI 2 "gpc_reg_operand" "")))
+		      (const_int 32))))]
+  "TARGET_POWERPC"
+  "
+{
+  if (TARGET_POWER)
+    {
+      emit_insn (gen_umulsi3_highpart_mq (operands[0], operands[1], operands[2]));
+      DONE;
+    }
+}")
+
+(define_insn "umulsi3_highpart_mq"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(truncate:SI
+	 (lshiftrt:DI (mult:DI (zero_extend:DI
+				(match_operand:SI 1 "gpc_reg_operand" "%r"))
+			       (zero_extend:DI
+				(match_operand:SI 2 "gpc_reg_operand" "r")))
+		      (const_int 32))))
+   (clobber (match_scratch:SI 3 "=q"))]
+  "TARGET_POWERPC && TARGET_POWER"
+  "mulhwu %0,%1,%2"
+  [(set_attr "type" "imul")])
+
+(define_insn "*umulsi3_highpart_no_mq"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(truncate:SI
+	 (lshiftrt:DI (mult:DI (zero_extend:DI
+				(match_operand:SI 1 "gpc_reg_operand" "%r"))
+			       (zero_extend:DI
+				(match_operand:SI 2 "gpc_reg_operand" "r")))
+		      (const_int 32))))]
+  "TARGET_POWERPC && ! TARGET_POWER"
+  "mulhwu %0,%1,%2"
+  [(set_attr "type" "imul")])
+
+;; If operands 0 and 2 are in the same register, we have a problem.  But
+;; operands 0 and 1 (the usual case) can be in the same register.  That's
+;; why we have the strange constraints below.
+(define_insn "ashldi3_power"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,&r")
+	(ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r,r,0,r")
+		   (match_operand:SI 2 "reg_or_cint_operand" "M,i,r,r")))
+   (clobber (match_scratch:SI 3 "=X,q,q,q"))]
+  "TARGET_POWER"
+  "@
+   {sli|slwi} %0,%L1,%h2\;{cal %L0,0(0)|li %L0,0}
+   sl%I2q %L0,%L1,%h2\;sll%I2q %0,%1,%h2
+   sl%I2q %L0,%L1,%h2\;sll%I2q %0,%1,%h2
+   sl%I2q %L0,%L1,%h2\;sll%I2q %0,%1,%h2"
+  [(set_attr "length" "8")])
+
+(define_insn "lshrdi3_power"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,&r")
+	(lshiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r,0,r")
+		     (match_operand:SI 2 "reg_or_cint_operand" "M,i,r,r")))
+   (clobber (match_scratch:SI 3 "=X,q,q,q"))]
+  "TARGET_POWER"
+  "@
+   {s%A2i|s%A2wi} %L0,%1,%h2\;{cal %0,0(0)|li %0,0}
+   sr%I2q %0,%1,%h2\;srl%I2q %L0,%L1,%h2
+   sr%I2q %0,%1,%h2\;srl%I2q %L0,%L1,%h2
+   sr%I2q %0,%1,%h2\;srl%I2q %L0,%L1,%h2"
+  [(set_attr "length" "8")])
+
+;; Shift by a variable amount is too complex to be worth open-coding.  We
+;; just handle shifts by constants.
+(define_insn "ashrdi3_power"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,r")
+	(ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
+		     (match_operand:SI 2 "const_int_operand" "M,i")))
+   (clobber (match_scratch:SI 3 "=X,q"))]
+  "TARGET_POWER"
+  "@
+   {srai|srawi} %0,%1,31\;{srai|srawi} %L0,%1,%h2
+   sraiq %0,%1,%h2\;srliq %L0,%L1,%h2"
+  [(set_attr "length" "8")])
+
+;; PowerPC64 DImode operations.
+
+(define_expand "adddi3"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+	(plus:DI (match_operand:DI 1 "gpc_reg_operand" "")
+		 (match_operand:DI 2 "reg_or_cint_operand" "")))]
+  ""
+  "
+{
+  if (! TARGET_POWERPC64)
+    {
+      if (non_short_cint_operand (operands[2], DImode))
+	FAIL;
+    }
+  else
+    if (GET_CODE (operands[2]) == CONST_INT
+	&& ! add_operand (operands[2], DImode))
+      {
+	rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1]))
+		   ? operands[0] : gen_reg_rtx (DImode));
+
+	HOST_WIDE_INT low = INTVAL (operands[2]) & 0xffff;
+	HOST_WIDE_INT high = INTVAL (operands[2]) & (~ (HOST_WIDE_INT) 0xffff);
+
+	if (low & 0x8000)
+	  high += 0x10000, low |= ((HOST_WIDE_INT) -1) << 16;
+
+	emit_insn (gen_adddi3 (tmp, operands[1], GEN_INT (high)));
+	emit_insn (gen_adddi3 (operands[0], tmp, GEN_INT (low)));
+	DONE;
+      }
+}")
+
+;; Discourage ai/addic because of carry but provide it in an alternative
+;; allowing register zero as source.
+
+(define_insn "*adddi3_internal1"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,?r,r")
+	(plus:DI (match_operand:DI 1 "gpc_reg_operand" "%r,b,r,b")
+		 (match_operand:DI 2 "add_operand" "r,I,I,L")))]
+  "TARGET_POWERPC64"
+  "@
+   add %0,%1,%2
+   addi %0,%1,%2
+   addic %0,%1,%2
+   addis %0,%1,%v2")
+
+(define_insn "*adddi3_internal2"
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x,x")
+	(compare:CC (plus:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r")
+			     (match_operand:DI 2 "reg_or_short_operand" "r,I"))
+		    (const_int 0)))
+   (clobber (match_scratch:DI 3 "=r,r"))]
+  "TARGET_POWERPC64"
+  "@
+   add. %3,%1,%2
+   addic. %3,%1,%2"
+  [(set_attr "type" "compare")])
+
+(define_insn "*adddi3_internal3"
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x,x")
+	(compare:CC (plus:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r")
+			     (match_operand:DI 2 "reg_or_short_operand" "r,I"))
+		    (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
+	(plus:DI (match_dup 1) (match_dup 2)))]
+  "TARGET_POWERPC64"
+  "@
+   add. %0,%1,%2
+   addic. %0,%1,%2"
+  [(set_attr "type" "compare")])
+
+;; Split an add that we can't do in one insn into two insns, each of which
+;; does one 16-bit part.  This is used by combine.  Note that the low-order
+;; add should be last in case the result gets used in an address.
+
+(define_split
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+	(plus:DI (match_operand:DI 1 "gpc_reg_operand" "")
+		 (match_operand:DI 2 "non_add_cint_operand" "")))]
+  "TARGET_POWERPC64"
+  [(set (match_dup 0) (plus:DI (match_dup 1) (match_dup 3)))
+   (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 4)))]
+"
+{
+  HOST_WIDE_INT low = INTVAL (operands[2]) & 0xffff;
+  HOST_WIDE_INT high = INTVAL (operands[2]) & (~ (HOST_WIDE_INT) 0xffff);
+
+  if (low & 0x8000)
+    high+=0x10000, low |= ((HOST_WIDE_INT) -1) << 16;
+
+  operands[3] = GEN_INT (high);
+  operands[4] = GEN_INT (low);
+}")
+
+(define_insn "one_cmpldi2"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(not:DI (match_operand:DI 1 "gpc_reg_operand" "r")))]
+  "TARGET_POWERPC64"
+  "nor %0,%1,%1")
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (not:DI (match_operand:DI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (clobber (match_scratch:DI 2 "=r"))]
+  "TARGET_POWERPC64"
+  "nor. %2,%1,%1"
+  [(set_attr "type" "compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 2 "cc_reg_operand" "=x")
+	(compare:CC (not:DI (match_operand:DI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(not:DI (match_dup 1)))]
+  "TARGET_POWERPC64"
+  "nor. %0,%1,%1"
+  [(set_attr "type" "compare")])
+
+(define_insn ""
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
+	(minus:DI (match_operand:DI 1 "reg_or_short_operand" "r,I")
+		  (match_operand:DI 2 "gpc_reg_operand" "r,r")))]
+  "TARGET_POWERPC64"
+  "@
+   subf %0,%2,%1
+   subfic %0,%2,%1")
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (minus:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+			      (match_operand:DI 2 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (clobber (match_scratch:DI 3 "=r"))]
+  "TARGET_POWERPC64"
+  "subf. %3,%2,%1"
+  [(set_attr "type" "compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC (minus:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+			      (match_operand:DI 2 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(minus:DI (match_dup 1) (match_dup 2)))]
+  "TARGET_POWERPC64"
+  "subf. %0,%2,%1"
+  [(set_attr "type" "compare")])
+
+(define_expand "subdi3"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+	(minus:DI (match_operand:DI 1 "reg_or_short_operand" "")
+		  (match_operand:DI 2 "reg_or_cint_operand" "")))]
+  ""
+  "
+{
+  if (GET_CODE (operands[2]) == CONST_INT)
+    {
+      emit_insn (gen_adddi3 (operands[0], operands[1],
+			     negate_rtx (DImode, operands[2])));
+      DONE;
+    }
+}")
+
+(define_insn "absdi2"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,r")
+	(abs:DI (match_operand:DI 1 "gpc_reg_operand" "r,0")))
+   (clobber (match_scratch:DI 2 "=&r,&r"))]
+  "TARGET_POWERPC64"
+  "sradi %2,%1,63\;xor %0,%2,%1\;subf %0,%2,%0"
+  [(set_attr "length" "12")])
+
+(define_split
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,r")
+	(abs:DI (match_operand:DI 1 "gpc_reg_operand" "r,0")))
+   (clobber (match_scratch:DI 2 "=&r,&r"))]
+  "TARGET_POWERPC64 && reload_completed"
+  [(set (match_dup 2) (ashiftrt:DI (match_dup 1) (const_int 63)))
+   (set (match_dup 0) (xor:DI (match_dup 2) (match_dup 1)))
+   (set (match_dup 0) (minus:DI (match_dup 0) (match_dup 2)))]
+  "")
+
+(define_insn "*nabsdi2"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,r")
+	(neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r,0"))))
+   (clobber (match_scratch:DI 2 "=&r,&r"))]
+  "TARGET_POWERPC64"
+  "sradi %2,%1,63\;xor %0,%2,%1\;subf %0,%0,%2"
+  [(set_attr "length" "12")])
+
+(define_split
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,r")
+	(neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r,0"))))
+   (clobber (match_scratch:DI 2 "=&r,&r"))]
+  "TARGET_POWERPC64 && reload_completed"
+  [(set (match_dup 2) (ashiftrt:DI (match_dup 1) (const_int 63)))
+   (set (match_dup 0) (xor:DI (match_dup 2) (match_dup 1)))
+   (set (match_dup 0) (minus:DI (match_dup 2) (match_dup 0)))]
+  "")
+
+(define_expand "negdi2"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+	(neg:DI (match_operand:DI 1 "gpc_reg_operand" "")))]
+  ""
+  "")
+
+(define_insn ""
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(neg:DI (match_operand:DI 1 "gpc_reg_operand" "r")))]
+  "TARGET_POWERPC64"
+  "neg %0,%1")
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (neg:DI (match_operand:DI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (clobber (match_scratch:DI 2 "=r"))]
+  "TARGET_POWERPC64"
+  "neg. %2,%1"
+  [(set_attr "type" "compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 2 "cc_reg_operand" "=x")
+	(compare:CC (neg:DI (match_operand:DI 1 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(neg:DI (match_dup 1)))]
+  "TARGET_POWERPC64"
+  "neg. %0,%1"
+  [(set_attr "type" "compare")])
+
+(define_insn "ffsdi2"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=&r")
+	(ffs:DI (match_operand:DI 1 "gpc_reg_operand" "r")))]
+  "TARGET_POWERPC64"
+  "neg %0,%1\;and %0,%0,%1\;cntlzd %0,%0\;subfic %0,%0,64"
+  [(set_attr "length" "16")])
+
+(define_insn "muldi3"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(mult:DI (match_operand:DI 1 "gpc_reg_operand" "%r")
+		 (match_operand:DI 2 "gpc_reg_operand" "r")))]
+  "TARGET_POWERPC64"
+  "mulld %0,%1,%2"
+   [(set_attr "type" "imul")])
+
+(define_insn "smuldi3_highpart"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(truncate:DI
+	 (lshiftrt:TI (mult:TI (sign_extend:TI
+				(match_operand:DI 1 "gpc_reg_operand" "%r"))
+			       (sign_extend:TI
+				(match_operand:DI 2 "gpc_reg_operand" "r")))
+		      (const_int 64))))]
+  "TARGET_POWERPC64"
+  "mulhd %0,%1,%2"
+  [(set_attr "type" "imul")])
+
+(define_insn "umuldi3_highpart"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(truncate:DI
+	 (lshiftrt:TI (mult:TI (zero_extend:TI
+				(match_operand:DI 1 "gpc_reg_operand" "%r"))
+			       (zero_extend:TI
+				(match_operand:DI 2 "gpc_reg_operand" "r")))
+		      (const_int 64))))]
+  "TARGET_POWERPC64"
+  "mulhdu %0,%1,%2"
+  [(set_attr "type" "imul")])
+
+(define_expand "divdi3"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+	(div:DI (match_operand:DI 1 "gpc_reg_operand" "")
+		(match_operand:DI 2 "reg_or_cint_operand" "")))]
+  "TARGET_POWERPC64"
+  "
+{
+  if (GET_CODE (operands[2]) == CONST_INT
+      && exact_log2 (INTVAL (operands[2])) >= 0)
+    ;
+  else
+    operands[2] = force_reg (DImode, operands[2]);
+}")
+
+(define_expand "moddi3"
+  [(use (match_operand:DI 0 "gpc_reg_operand" ""))
+   (use (match_operand:DI 1 "gpc_reg_operand" ""))
+   (use (match_operand:DI 2 "reg_or_cint_operand" ""))]
+  "TARGET_POWERPC64"
+  "
+{
+  int i = exact_log2 (INTVAL (operands[2]));
+  rtx temp1;
+  rtx temp2;
+
+  if (GET_CODE (operands[2]) != CONST_INT || i < 0)
+    FAIL;
+
+  temp1 = gen_reg_rtx (DImode);
+  temp2 = gen_reg_rtx (DImode);
+
+  emit_insn (gen_divdi3 (temp1, operands[1], operands[2]));
+  emit_insn (gen_ashldi3 (temp2, temp1, GEN_INT (i)));
+  emit_insn (gen_subdi3 (operands[0], operands[1], temp2));
+  DONE;
+}")
+
+(define_insn ""
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(div:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+		(match_operand:DI 2 "const_int_operand" "N")))]
+  "TARGET_POWERPC64 && exact_log2 (INTVAL (operands[2])) >= 0"
+  "sradi %0,%1,%p2\;addze %0,%0"
+  [(set_attr "length" "8")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (div:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+			    (match_operand:DI 2 "const_int_operand" "N"))
+		    (const_int 0)))
+   (clobber (match_scratch:DI 3 "=r"))]
+  "TARGET_POWERPC64 && exact_log2 (INTVAL (operands[2])) >= 0"
+  "sradi %3,%1,%p2\;addze. %3,%3"
+  [(set_attr "type" "compare")
+   (set_attr "length" "8")])
+
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC (div:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+			    (match_operand:DI 2 "const_int_operand" "N"))
+		    (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(div:DI (match_dup 1) (match_dup 2)))]
+  "TARGET_POWERPC64 && exact_log2 (INTVAL (operands[2])) >= 0"
+  "sradi %0,%1,%p2\;addze. %0,%0"
+  [(set_attr "type" "compare")
+   (set_attr "length" "8")])
+
+(define_insn ""
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+        (div:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+                (match_operand:DI 2 "gpc_reg_operand" "r")))]
+  "TARGET_POWERPC64"
+  "divd %0,%1,%2"
+  [(set_attr "type" "idiv")])
+
+(define_insn "udivdi3"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+        (udiv:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+                 (match_operand:DI 2 "gpc_reg_operand" "r")))]
+  "TARGET_POWERPC64"
+  "divdu %0,%1,%2"
+  [(set_attr "type" "idiv")])
+
+(define_insn "rotldi3"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+		   (match_operand:DI 2 "reg_or_cint_operand" "ri")))]
+  "TARGET_POWERPC64"
+  "rld%I2cl %0,%1,%H2,0")
+
+(define_insn "*rotldi3_internal2"
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+			       (match_operand:DI 2 "reg_or_cint_operand" "ri"))
+		    (const_int 0)))
+   (clobber (match_scratch:DI 3 "=r"))]
+  "TARGET_POWERPC64"
+  "rld%I2cl. %3,%1,%H2,0"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn "*rotldi3_internal3"
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+			       (match_operand:DI 2 "reg_or_cint_operand" "ri"))
+		    (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(rotate:DI (match_dup 1) (match_dup 2)))]
+  "TARGET_POWERPC64"
+  "rld%I2cl. %0,%1,%H2,0"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn "*rotldi3_internal4"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(and:DI (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+			   (match_operand:DI 2 "reg_or_cint_operand" "ri"))
+		(match_operand:DI 3 "mask64_operand" "S")))]
+  "TARGET_POWERPC64"
+  "rld%I2c%B3 %0,%1,%H2,%S3")
+
+(define_insn "*rotldi3_internal5"
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (and:DI
+		     (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+				(match_operand:DI 2 "reg_or_cint_operand" "ri"))
+		     (match_operand:DI 3 "mask64_operand" "S"))
+		    (const_int 0)))
+   (clobber (match_scratch:DI 4 "=r"))]
+  "TARGET_POWERPC64"
+  "rld%I2c%B3. %4,%1,%H2,%S3"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn "*rotldi3_internal6"
+  [(set (match_operand:CC 4 "cc_reg_operand" "=x")
+	(compare:CC (and:DI
+		     (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+				(match_operand:DI 2 "reg_or_cint_operand" "ri"))
+		     (match_operand:DI 3 "mask64_operand" "S"))
+		    (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(and:DI (rotate:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
+  "TARGET_POWERPC64"
+  "rld%I2c%B3. %0,%1,%H2,%S3"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn "*rotldi3_internal7"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(zero_extend:DI
+	 (subreg:QI
+	  (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+		     (match_operand:DI 2 "reg_or_cint_operand" "ri")) 0)))]
+  "TARGET_POWERPC64"
+  "rld%I2cl %0,%1,%H2,56")
+
+(define_insn "*rotldi3_internal8"
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (zero_extend:DI
+		     (subreg:QI
+		      (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+				 (match_operand:DI 2 "reg_or_cint_operand" "ri")) 0))
+		    (const_int 0)))
+   (clobber (match_scratch:DI 3 "=r"))]
+  "TARGET_POWERPC64"
+  "rld%I2cl. %3,%1,%H2,56"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn "*rotldi3_internal9"
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC (zero_extend:DI
+		     (subreg:QI
+		      (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+				 (match_operand:DI 2 "reg_or_cint_operand" "ri")) 0))
+		    (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(zero_extend:DI (subreg:QI (rotate:DI (match_dup 1) (match_dup 2)) 0)))]
+  "TARGET_POWERPC64"
+  "rld%I2cl. %0,%1,%H2,56"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn "*rotldi3_internal10"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(zero_extend:DI
+	 (subreg:HI
+	  (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+		     (match_operand:DI 2 "reg_or_cint_operand" "ri")) 0)))]
+  "TARGET_POWERPC64"
+  "rld%I2cl %0,%1,%H2,48")
+
+(define_insn "*rotldi3_internal11"
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (zero_extend:DI
+		     (subreg:HI
+		      (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+				 (match_operand:DI 2 "reg_or_cint_operand" "ri")) 0))
+		    (const_int 0)))
+   (clobber (match_scratch:DI 3 "=r"))]
+  "TARGET_POWERPC64"
+  "rld%I2cl. %3,%1,%H2,48"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn "*rotldi3_internal12"
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC (zero_extend:DI
+		     (subreg:HI
+		      (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+				 (match_operand:DI 2 "reg_or_cint_operand" "ri")) 0))
+		    (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(zero_extend:DI (subreg:HI (rotate:DI (match_dup 1) (match_dup 2)) 0)))]
+  "TARGET_POWERPC64"
+  "rld%I2cl. %0,%1,%H2,48"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn "*rotldi3_internal13"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(zero_extend:DI
+	 (subreg:SI
+	  (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+		     (match_operand:DI 2 "reg_or_cint_operand" "ri")) 0)))]
+  "TARGET_POWERPC64"
+  "rld%I2cl %0,%1,%H2,32")
+
+(define_insn "*rotldi3_internal14"
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (zero_extend:DI
+		     (subreg:SI
+		      (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+				 (match_operand:DI 2 "reg_or_cint_operand" "ri")) 0))
+		    (const_int 0)))
+   (clobber (match_scratch:DI 3 "=r"))]
+  "TARGET_POWERPC64"
+  "rld%I2cl. %3,%1,%H2,32"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn "*rotldi3_internal15"
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC (zero_extend:DI
+		     (subreg:SI
+		      (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+				 (match_operand:DI 2 "reg_or_cint_operand" "ri")) 0))
+		    (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(zero_extend:DI (subreg:SI (rotate:DI (match_dup 1) (match_dup 2)) 0)))]
+  "TARGET_POWERPC64"
+  "rld%I2cl. %0,%1,%H2,32"
+  [(set_attr "type" "delayed_compare")])
+
+(define_expand "ashldi3"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+	(ashift:DI (match_operand:DI 1 "gpc_reg_operand" "")
+		   (match_operand:SI 2 "reg_or_cint_operand" "")))]
+  "TARGET_POWERPC64 || TARGET_POWER"
+  "
+{
+  if (TARGET_POWERPC64)
+    ;
+  else if (TARGET_POWER)
+    {
+      emit_insn (gen_ashldi3_power (operands[0], operands[1], operands[2]));
+      DONE;
+    }
+  else
+    FAIL;
+}")
+
+(define_insn ""
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+		   (match_operand:SI 2 "reg_or_cint_operand" "ri")))]
+  "TARGET_POWERPC64"
+  "sld%I2 %0,%1,%H2"
+  [(set_attr "length" "8")])
+  
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+			       (match_operand:SI 2 "reg_or_cint_operand" "ri"))
+		    (const_int 0)))
+   (clobber (match_scratch:DI 3 "=r"))]
+  "TARGET_POWERPC64"
+  "sld%I2. %3,%1,%H2"
+  [(set_attr "type" "delayed_compare")])
+  
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+			       (match_operand:SI 2 "reg_or_cint_operand" "ri"))
+		    (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(ashift:DI (match_dup 1) (match_dup 2)))]
+  "TARGET_POWERPC64"
+  "sld%I2. %0,%1,%H2"
+  [(set_attr "type" "delayed_compare")])
+
+(define_expand "lshrdi3"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+	(lshiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "")
+		     (match_operand:SI 2 "reg_or_cint_operand" "")))]
+  "TARGET_POWERPC64 || TARGET_POWER"
+  "
+{
+  if (TARGET_POWERPC64)
+    ;
+  else if (TARGET_POWER)
+    {
+      emit_insn (gen_lshrdi3_power (operands[0], operands[1], operands[2]));
+      DONE;
+    }
+  else
+    FAIL;
+}")
+
+(define_insn ""
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(lshiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+		     (match_operand:SI 2 "reg_or_cint_operand" "ri")))]
+  "TARGET_POWERPC64"
+  "srd%I2 %0,%1,%H2")
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (lshiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+				 (match_operand:SI 2 "reg_or_cint_operand" "ri"))
+		    (const_int 0)))
+   (clobber (match_scratch:DI 3 "=r"))]
+  "TARGET_POWERPC64"
+  "srd%I2. %3,%1,%H2"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC (lshiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+				 (match_operand:SI 2 "reg_or_cint_operand" "ri"))
+		    (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(lshiftrt:DI (match_dup 1) (match_dup 2)))]
+  "TARGET_POWERPC64"
+  "srd%I2. %0,%1,%H2"
+  [(set_attr "type" "delayed_compare")])
+
+(define_expand "ashrdi3"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+	(ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "")
+		     (match_operand:SI 2 "reg_or_cint_operand" "")))]
+  "TARGET_POWERPC64 || TARGET_POWER"
+  "
+{
+  if (TARGET_POWERPC64)
+    ;
+  else if (TARGET_POWER && GET_CODE (operands[2]) == CONST_INT)
+    {
+      emit_insn (gen_ashrdi3_power (operands[0], operands[1], operands[2]));
+      DONE;
+    }
+  else
+    FAIL;
+}")
+
+(define_insn ""
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+		     (match_operand:SI 2 "reg_or_cint_operand" "ri")))]
+  "TARGET_POWERPC64"
+  "srad%I2 %0,%1,%H2")
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+				 (match_operand:SI 2 "reg_or_cint_operand" "ri"))
+		    (const_int 0)))
+   (clobber (match_scratch:DI 3 "=r"))]
+  "TARGET_POWERPC64"
+  "srad%I2. %3,%1,%H2"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+				 (match_operand:SI 2 "reg_or_cint_operand" "ri"))
+		    (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(ashiftrt:DI (match_dup 1) (match_dup 2)))]
+  "TARGET_POWERPC64"
+  "srad%I2. %0,%1,%H2"
+  [(set_attr "type" "delayed_compare")])
+
+(define_insn "anddi3"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r")
+	(and:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r")
+		(match_operand:DI 2 "and64_operand" "?r,S,K,J")))
+   (clobber (match_scratch:CC 3 "=X,X,x,x"))]
+  "TARGET_POWERPC64"
+  "@
+   and %0,%1,%2
+   rldic%B2 %0,%1,0,%S2
+   andi. %0,%1,%b2
+   andis. %0,%1,%u2")
+
+(define_insn "*anddi3_internal2"
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,x,x")
+	(compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r")
+			    (match_operand:DI 2 "and64_operand" "r,S,K,J"))
+		    (const_int 0)))
+   (clobber (match_scratch:DI 3 "=r,r,r,r"))]
+  "TARGET_POWERPC64"
+  "@
+   and. %3,%1,%2
+   rldic%B2. %3,%1,0,%S2
+   andi. %3,%1,%b2
+   andis. %3,%1,%u2"
+  [(set_attr "type" "compare,delayed_compare,compare,compare")])
+
+(define_insn "*anddi3_internal3"
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,x,x")
+	(compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r")
+			    (match_operand:DI 2 "and64_operand" "r,S,K,J"))
+		    (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r")
+	(and:DI (match_dup 1) (match_dup 2)))]
+  "TARGET_POWERPC64"
+  "@
+   and. %0,%1,%2
+   rldic%B2. %0,%1,0,%S2
+   andi. %0,%1,%b2
+   andis. %0,%1,%u2"
+  [(set_attr "type" "compare,delayed_compare,compare,compare")])
+
+(define_expand "iordi3"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+	(ior:DI (match_operand:DI 1 "gpc_reg_operand" "")
+		(match_operand:DI 2 "reg_or_u_cint_operand" "")))]
+  "TARGET_POWERPC64"
+  "
+{
+  if (GET_CODE (operands[2]) == CONST_INT
+      && ! logical_u_operand (operands[2], DImode))
+    {
+      HOST_WIDE_INT value = INTVAL (operands[2]);
+      rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1]))
+		 ? operands[0] : gen_reg_rtx (DImode));
+
+      emit_insn (gen_iordi3 (tmp, operands[1],
+			     GEN_INT (value & (~ (HOST_WIDE_INT) 0xffff))));
+      emit_insn (gen_iordi3 (operands[0], tmp, GEN_INT (value & 0xffff)));
+      DONE;
+    }
+  else if (GET_CODE (operands[2]) == CONST_DOUBLE
+      && ! logical_u_operand (operands[2], DImode))
+    {
+      HOST_WIDE_INT value = CONST_DOUBLE_LOW (operands[2]);
+      rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1]))
+		 ? operands[0] : gen_reg_rtx (DImode));
+
+      emit_insn (gen_iordi3 (tmp, operands[1],
+			     immed_double_const (value
+						 & (~ (HOST_WIDE_INT) 0xffff),
+					         0, DImode)));
+      emit_insn (gen_iordi3 (operands[0], tmp, GEN_INT (value & 0xffff)));
+      DONE;
+    }
+}")
+
+(define_insn "*iordi3_internal1"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r")
+	(ior:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r")
+		(match_operand:DI 2 "logical_u_operand" "r,K,JF")))]
+  "TARGET_POWERPC64"
+  "@
+   or %0,%1,%2
+   ori %0,%1,%b2
+   oris %0,%1,%u2")
+
+(define_insn "*iordi3_internal2"
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (ior:DI (match_operand:DI 1 "gpc_reg_operand" "%r")
+			    (match_operand:DI 2 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (clobber (match_scratch:DI 3 "=r"))]
+  "TARGET_POWERPC64"
+  "or. %3,%1,%2"
+  [(set_attr "type" "compare")])
+
+(define_insn "*iordi3_internal3"
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC (ior:DI (match_operand:DI 1 "gpc_reg_operand" "%r")
+			    (match_operand:DI 2 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(ior:DI (match_dup 1) (match_dup 2)))]
+  "TARGET_POWERPC64"
+  "or. %0,%1,%2"
+  [(set_attr "type" "compare")])
+
+;; Split an IOR that we can't do in one insn into two insns, each of which
+;; does one 16-bit part.  This is used by combine.
+
+(define_split
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+	(ior:DI (match_operand:DI 1 "gpc_reg_operand" "")
+		(match_operand:DI 2 "non_logical_u_cint_operand" "")))]
+  "TARGET_POWERPC64"
+  [(set (match_dup 0) (ior:DI (match_dup 1) (match_dup 3)))
+   (set (match_dup 0) (ior:DI (match_dup 0) (match_dup 4)))]
+"
+{
+  if (GET_CODE (operands[2]) == CONST_DOUBLE)
+    {
+      HOST_WIDE_INT value = CONST_DOUBLE_LOW (operands[2]);
+      operands[3] = immed_double_const (value & (~ (HOST_WIDE_INT) 0xffff),
+					0, DImode);
+      operands[4] = GEN_INT (value & 0xffff);
+    }
+  else
+    {
+      operands[3] = GEN_INT (INTVAL (operands[2])
+			     & (~ (HOST_WIDE_INT) 0xffff));
+      operands[4] = GEN_INT (INTVAL (operands[2]) & 0xffff);
+    }
+}")
+
+(define_expand "xordi3"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+	(xor:DI (match_operand:DI 1 "gpc_reg_operand" "")
+		(match_operand:DI 2 "reg_or_u_cint_operand" "")))]
+  "TARGET_POWERPC64"
+  "
+{
+  if (GET_CODE (operands[2]) == CONST_INT
+      && ! logical_u_operand (operands[2], DImode))
+    {
+      HOST_WIDE_INT value = INTVAL (operands[2]);
+      rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1]))
+		 ? operands[0] : gen_reg_rtx (DImode));
+
+      emit_insn (gen_xordi3 (tmp, operands[1],
+			     GEN_INT (value & (~ (HOST_WIDE_INT) 0xffff))));
+      emit_insn (gen_xordi3 (operands[0], tmp, GEN_INT (value & 0xffff)));
+      DONE;
+    }
+  else if (GET_CODE (operands[2]) == CONST_DOUBLE
+      && ! logical_u_operand (operands[2], DImode))
+    {
+      HOST_WIDE_INT value = CONST_DOUBLE_LOW (operands[2]);
+      rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1]))
+		 ? operands[0] : gen_reg_rtx (DImode));
+
+      emit_insn (gen_xordi3 (tmp, operands[1],
+			     immed_double_const (value
+						 & (~ (HOST_WIDE_INT) 0xffff),
+					         0, DImode)));
+      emit_insn (gen_xordi3 (operands[0], tmp, GEN_INT (value & 0xffff)));
+      DONE;
+    }
+}")
+
+(define_insn "*xordi3_internal1"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r")
+	(xor:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r")
+		(match_operand:DI 2 "logical_u_operand" "r,K,JF")))]
+  "TARGET_POWERPC64"
+  "@
+   xor %0,%1,%2
+   xori %0,%1,%b2
+   xoris %0,%1,%u2")
+
+(define_insn "*xordi3_internal2"
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (xor:DI (match_operand:DI 1 "gpc_reg_operand" "%r")
+			    (match_operand:DI 2 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (clobber (match_scratch:DI 3 "=r"))]
+  "TARGET_POWERPC64"
+  "xor. %3,%1,%2"
+  [(set_attr "type" "compare")])
+
+(define_insn "*xordi3_internal3"
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC (xor:DI (match_operand:DI 1 "gpc_reg_operand" "%r")
+			    (match_operand:DI 2 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(xor:DI (match_dup 1) (match_dup 2)))]
+  "TARGET_POWERPC64"
+  "xor. %0,%1,%2"
+  [(set_attr "type" "compare")])
+
+;; Split an XOR that we can't do in one insn into two insns, each of which
+;; does one 16-bit part.  This is used by combine.
+
+(define_split
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+        (xor:DI (match_operand:DI 1 "gpc_reg_operand" "")
+                (match_operand:DI 2 "non_logical_u_cint_operand" "")))]
+  "TARGET_POWERPC64"
+  [(set (match_dup 0) (xor:DI (match_dup 1) (match_dup 3)))
+   (set (match_dup 0) (xor:DI (match_dup 0) (match_dup 4)))]
+"
+{
+  if (GET_CODE (operands[2]) == CONST_DOUBLE)
+    {
+      HOST_WIDE_INT value = CONST_DOUBLE_LOW (operands[2]);
+      operands[3] = immed_double_const (value & (~ (HOST_WIDE_INT) 0xffff),
+					0, DImode);
+      operands[4] = GEN_INT (value & 0xffff);
+    }
+  else
+    {
+      operands[3] = GEN_INT (INTVAL (operands[2])
+			     & (~ (HOST_WIDE_INT) 0xffff));
+      operands[4] = GEN_INT (INTVAL (operands[2]) & 0xffff);
+    }
+}")
+
+(define_insn "*eqvdi3_internal1"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(not:DI (xor:DI (match_operand:DI 1 "gpc_reg_operand" "%r")
+			(match_operand:DI 2 "gpc_reg_operand" "r"))))]
+   "TARGET_POWERPC64"
+   "eqv %0,%1,%2")
+
+(define_insn "*eqvdi3_internal2"
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (not:DI (xor:DI (match_operand:DI 1 "gpc_reg_operand" "%r")
+				    (match_operand:DI 2 "gpc_reg_operand" "r")))
+		    (const_int 0)))
+   (clobber (match_scratch:DI 3 "=r"))]
+   "TARGET_POWERPC64"
+   "eqv. %3,%1,%2"
+   [(set_attr "type" "compare")])
+
+(define_insn "*eqvdi3_internal3"
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC (not:DI (xor:DI (match_operand:DI 1 "gpc_reg_operand" "%r")
+				    (match_operand:DI 2 "gpc_reg_operand" "r")))
+		    (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(not:DI (xor:DI (match_dup 1) (match_dup 2))))]
+   "TARGET_POWERPC64"
+   "eqv. %0,%1,%2"
+   [(set_attr "type" "compare")])
+
+(define_insn "*andcdi3_internal1"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(and:DI (not:DI (match_operand:DI 1 "gpc_reg_operand" "r"))
+		(match_operand:DI 2 "gpc_reg_operand" "r")))]
+  "TARGET_POWERPC64"
+  "andc %0,%2,%1")
+
+(define_insn "*andcdi3_internal2"
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (and:DI (not:DI (match_operand:DI 1 "gpc_reg_operand" "r"))
+			    (match_operand:DI 2 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (clobber (match_scratch:DI 3 "=r"))]
+  "TARGET_POWERPC64"
+  "andc. %3,%2,%1"
+  [(set_attr "type" "compare")])
+
+(define_insn "*andcdi3_internal3"
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC (and:DI (not:DI (match_operand:DI 1 "gpc_reg_operand" "r"))
+			    (match_operand:DI 2 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(and:DI (not:DI (match_dup 1)) (match_dup 2)))]
+  "TARGET_POWERPC64"
+  "andc. %0,%2,%1"
+  [(set_attr "type" "compare")])
+
+(define_insn "*iorcdi3_internal1"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(ior:DI (not:DI (match_operand:DI 1 "gpc_reg_operand" "r"))
+		(match_operand:DI 2 "gpc_reg_operand" "r")))]
+  "TARGET_POWERPC64"
+  "orc %0,%2,%1")
+
+(define_insn "*iorcdi3_inernal2"
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (ior:DI (not:DI (match_operand:DI 1 "gpc_reg_operand" "r"))
+			    (match_operand:DI 2 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (clobber (match_scratch:DI 3 "=r"))]
+  "TARGET_POWERPC64"
+  "orc. %3,%2,%1"
+  [(set_attr "type" "compare")])
+
+(define_insn "*iorcdi3_internal3"
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC (ior:DI (not:DI (match_operand:DI 1 "gpc_reg_operand" "r"))
+			    (match_operand:DI 2 "gpc_reg_operand" "r"))
+		    (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(ior:DI (not:DI (match_dup 1)) (match_dup 2)))]
+  "TARGET_POWERPC64"
+  "orc. %0,%2,%1"
+  [(set_attr "type" "compare")])
+
+(define_insn "*nanddi3_internal1"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(ior:DI (not:DI (match_operand:DI 1 "gpc_reg_operand" "%r"))
+		(not:DI (match_operand:DI 2 "gpc_reg_operand" "r"))))]
+  "TARGET_POWERPC64"
+  "nand %0,%1,%2")
+
+(define_insn "*nanddi3_internal2"
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (ior:DI (not:DI (match_operand:DI 1 "gpc_reg_operand" "%r"))
+			    (not:DI (match_operand:DI 2 "gpc_reg_operand" "r")))
+		    (const_int 0)))
+   (clobber (match_scratch:DI 3 "=r"))]
+  "TARGET_POWERPC64"
+  "nand. %3,%1,%2"
+  [(set_attr "type" "compare")])
+
+(define_insn "*nanddi3_internal3"
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC (ior:DI (not:DI (match_operand:DI 1 "gpc_reg_operand" "%r"))
+			    (not:DI (match_operand:DI 2 "gpc_reg_operand" "r")))
+		    (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(ior:DI (not:DI (match_dup 1)) (not:DI (match_dup 2))))]
+  "TARGET_POWERPC64"
+  "nand. %0,%1,%2"
+  [(set_attr "type" "compare")])
+
+(define_insn "*nordi3_internal1"
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(and:DI (not:DI (match_operand:DI 1 "gpc_reg_operand" "%r"))
+		(not:DI (match_operand:DI 2 "gpc_reg_operand" "r"))))]
+  "TARGET_POWERPC64"
+  "nor %0,%1,%2")
+
+(define_insn "*nordi3_internal2"
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (and:DI (not:DI (match_operand:DI 1 "gpc_reg_operand" "%r"))
+			    (not:DI (match_operand:DI 2 "gpc_reg_operand" "r")))
+		    (const_int 0)))
+   (clobber (match_scratch:DI 3 "=r"))]
+  "TARGET_POWERPC64"
+  "nor. %3,%1,%2"
+  [(set_attr "type" "compare")])
+
+(define_insn "*nordi3_internal3"
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC (and:DI (not:DI (match_operand:DI 1 "gpc_reg_operand" "%r"))
+			    (not:DI (match_operand:DI 2 "gpc_reg_operand" "r")))
+		    (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(and:DI (not:DI (match_dup 1)) (not:DI (match_dup 2))))]
+  "TARGET_POWERPC64"
+  "nor. %0,%1,%2"
+  [(set_attr "type" "compare")])
+
+;; Now define ways of moving data around.
+
+;; Elf specific ways of loading addresses for non-PIC code.
+;; The output of this could be r0, but we limit it to base
+;; registers, since almost all uses of this will need it
+;; in a base register shortly.
+(define_insn "elf_high"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=b")
+	(high:SI (match_operand 1 "" "")))]
+  "TARGET_ELF && ! TARGET_64BIT"
+  "{liu|lis} %0,%1@ha")
+
+(define_insn "elf_low"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b")
+		   (match_operand 2 "" "")))]
+   "TARGET_ELF && ! TARGET_64BIT"
+   "{cal|la} %0,%2@l(%1)")
+
+;; Set up a register with a value from the GOT table
+
+(define_expand "movsi_got"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "")
+	(unspec [(match_operand:SI 1 "got_operand" "")
+		 (match_dup 2)] 8))]
+  "(DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS) && flag_pic == 1"
+  "
+{
+  if (GET_CODE (operands[1]) == CONST)
+    {
+      rtx offset = const0_rtx;
+      HOST_WIDE_INT value;
+
+      operands[1] = eliminate_constant_term (XEXP (operands[1], 0), &offset);
+      value = INTVAL (offset);
+      if (value != 0)
+	{
+	  rtx tmp = (no_new_pseudos ? operands[0] : gen_reg_rtx (Pmode));
+	  emit_insn (gen_movsi_got (tmp, operands[1]));
+	  emit_insn (gen_addsi3 (operands[0], tmp, offset));
+	  DONE;
+	}
+    }
+
+  operands[2] = rs6000_got_register (operands[1]);
+}")
+
+(define_insn "*movsi_got_internal"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(unspec [(match_operand:SI 1 "got_no_const_operand" "")
+		 (match_operand:SI 2 "gpc_reg_operand" "b")] 8))]
+  "(DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS) && flag_pic == 1"
+  "{l|lwz} %0,%a1@got(%2)"
+  [(set_attr "type" "load")])
+
+;; Used by sched, shorten_branches and final when the GOT pseudo reg
+;; didn't get allocated to a hard register.
+(define_split 
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(unspec [(match_operand:SI 1 "got_no_const_operand" "")
+		 (match_operand:SI 2 "memory_operand" "m")] 8))]
+  "(DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS)
+    && flag_pic == 1
+    && (reload_in_progress || reload_completed)"
+  [(set (match_dup 0) (match_dup 2))
+   (set (match_dup 0) (unspec [(match_dup 1)(match_dup 0)] 8))]
+  "")
+
+;; For SI, we special-case integers that can't be loaded in one insn.  We
+;; do the load 16-bits at a time.  We could do this by loading from memory,
+;; and this is even supposed to be faster, but it is simpler not to get
+;; integers in the TOC.
+(define_expand "movsi"
+  [(set (match_operand:SI 0 "general_operand" "")
+	(match_operand:SI 1 "any_operand" ""))]
+  ""
+  "
+{
+  if (GET_CODE (operands[0]) != REG)
+    operands[1] = force_reg (SImode, operands[1]);
+
+  /* Convert a move of a CONST_DOUBLE into a CONST_INT */
+  if (GET_CODE (operands[1]) == CONST_DOUBLE)
+    operands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1]));
+
+  /* Only a tiny bit of handling for CONSTANT_P_RTX is necessary.  */
+  if (GET_CODE (operands[1]) == CONSTANT_P_RTX)
+    {
+      emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
+      DONE;
+    }
+
+  /* Use default pattern for address of ELF small data */
+  if (TARGET_ELF
+      && (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS)
+      && (GET_CODE (operands[1]) == SYMBOL_REF || GET_CODE (operands[1]) == CONST)
+      && small_data_operand (operands[1], SImode))
+    {
+      emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
+      DONE;
+    }
+
+  if ((DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS)
+      && flag_pic == 1 && got_operand (operands[1], SImode))
+    {
+      emit_insn (gen_movsi_got (operands[0], operands[1]));
+      DONE;
+    }
+
+  if (TARGET_ELF && TARGET_NO_TOC && ! TARGET_64BIT
+      && ! flag_pic
+      && CONSTANT_P (operands[1])
+      && GET_CODE (operands[1]) != HIGH
+      && GET_CODE (operands[1]) != CONST_INT)
+    {
+      rtx target = (no_new_pseudos ? operands[0] : gen_reg_rtx (SImode));
+
+      /* If this is a function address on -mcall-aixdesc or -mcall-nt,
+	 convert it to the address of the descriptor.  */
+      if ((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT)
+	  && GET_CODE (operands[1]) == SYMBOL_REF
+	  && XSTR (operands[1], 0)[0] == '.')
+	{
+	  char *name = XSTR (operands[1], 0);
+	  rtx new_ref;
+	  while (*name == '.')
+	    name++;
+	  new_ref = gen_rtx_SYMBOL_REF (Pmode, name);
+	  CONSTANT_POOL_ADDRESS_P (new_ref) = CONSTANT_POOL_ADDRESS_P (operands[1]);
+	  SYMBOL_REF_FLAG (new_ref) = SYMBOL_REF_FLAG (operands[1]);
+	  SYMBOL_REF_USED (new_ref) = SYMBOL_REF_USED (operands[1]);
+	  operands[1] = new_ref;
+	}
+
+      emit_insn (gen_elf_high (target, operands[1]));
+      emit_insn (gen_elf_low (operands[0], target, operands[1]));
+      DONE;
+    }
+
+  if (GET_CODE (operands[1]) == CONST
+      && DEFAULT_ABI == ABI_NT
+      && ! side_effects_p (operands[0]))
+    {
+      rtx const_term = const0_rtx;
+      rtx sym = eliminate_constant_term (XEXP (operands[1], 0), &const_term);
+      if (sym && GET_CODE (const_term) == CONST_INT
+	  && (GET_CODE (sym) == SYMBOL_REF || GET_CODE (sym) == LABEL_REF))
+	{
+	  unsigned HOST_WIDE_INT value = INTVAL (const_term);
+	  int new_reg_p = (flag_expensive_optimizations && ! no_new_pseudos);
+	  rtx tmp1 = ((new_reg_p && value != 0)
+		      ? gen_reg_rtx (SImode) : operands[0]);
+
+	  emit_insn (gen_movsi (tmp1, sym));
+	  if (INTVAL (const_term) != 0)
+	    emit_insn (gen_addsi3 (operands[0], tmp1, GEN_INT (value)));
+	  DONE;
+	}
+      else
+	rs6000_fatal_bad_address (operands[1]);
+    }
+
+  if ((! TARGET_WINDOWS_NT || DEFAULT_ABI != ABI_NT)
+      && CONSTANT_P (operands[1])
+      && GET_CODE (operands[1]) != CONST_INT
+      && GET_CODE (operands[1]) != HIGH
+      && ! LEGITIMATE_CONSTANT_POOL_ADDRESS_P (operands[1]))
+    {
+      /* Emit a USE operation so that the constant isn't deleted if
+	 expensive optimizations are turned on because nobody
+	 references it.  This should only be done for operands that
+	 contain SYMBOL_REFs with CONSTANT_POOL_ADDRESS_P set.
+	 This should not be done for operands that contain LABEL_REFs.
+	 For now, we just handle the obvious case.  */
+      if (GET_CODE (operands[1]) != LABEL_REF)
+	emit_insn (gen_rtx_USE (VOIDmode, operands[1]));
+
+      /* If we are to limit the number of things we put in the TOC and
+	 this is a symbol plus a constant we can add in one insn,
+	 just put the symbol in the TOC and add the constant.  Don't do
+	 this if reload is in progress.  */
+      if (GET_CODE (operands[1]) == CONST
+	  && TARGET_NO_SUM_IN_TOC && ! reload_in_progress
+	  && GET_CODE (XEXP (operands[1], 0)) == PLUS
+	  && add_operand (XEXP (XEXP (operands[1], 0), 1), SImode)
+	  && (GET_CODE (XEXP (XEXP (operands[1], 0), 0)) == LABEL_REF
+	      || GET_CODE (XEXP (XEXP (operands[1], 0), 0)) == SYMBOL_REF)
+	  && ! side_effects_p (operands[0]))
+	{
+	  rtx sym = force_const_mem (SImode, XEXP (XEXP (operands[1], 0), 0));
+	  rtx other = XEXP (XEXP (operands[1], 0), 1);
+
+	  emit_insn (gen_addsi3 (operands[0], force_reg (SImode, sym), other));
+	  DONE;
+	}
+
+      operands[1] = force_const_mem (SImode, operands[1]);
+      if (! memory_address_p (SImode, XEXP (operands[1], 0))
+	  && ! reload_in_progress)
+	operands[1] = change_address (operands[1], SImode,
+				      XEXP (operands[1], 0));
+    }
+}")
+
+(define_insn ""
+  [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,m,r,r,r,r,r,*q,*c*l,*h")
+	(match_operand:SI 1 "input_operand" "r,U,m,r,I,L,n,R,*h,r,r,0"))]
+  "gpc_reg_operand (operands[0], SImode)
+   || gpc_reg_operand (operands[1], SImode)"
+  "@
+   mr %0,%1
+   {cal|la} %0,%a1
+   {l%U1%X1|lwz%U1%X1} %0,%1
+   {st%U0%X0|stw%U0%X0} %1,%0
+   {lil|li} %0,%1
+   {liu|lis} %0,%v1
+   #
+   {cal|la} %0,%1(%*)
+   mf%1 %0
+   mt%0 %1
+   mt%0 %1
+   cror 0,0,0"
+  [(set_attr "type" "*,*,load,store,*,*,*,*,*,*,mtjmpr,*")
+   (set_attr "length" "4,4,4,4,4,4,8,4,4,4,4,4")])
+
+;; Split a load of a large constant into the appropriate two-insn
+;; sequence.
+
+(define_split
+  [(set (match_operand:SI 0 "gpc_reg_operand" "")
+	(match_operand:SI 1 "const_int_operand" ""))]
+  "(unsigned HOST_WIDE_INT) (INTVAL (operands[1]) + 0x8000) >= 0x10000
+   && (INTVAL (operands[1]) & 0xffff) != 0"
+  [(set (match_dup 0)
+	(match_dup 2))
+   (set (match_dup 0)
+	(ior:SI (match_dup 0)
+		(match_dup 3)))]
+  "
+{
+  operands[2] = GEN_INT (INTVAL (operands[1]) & 0xffff0000);
+  operands[3] = GEN_INT (INTVAL (operands[1]) & 0xffff);
+}")
+
+(define_insn ""
+  [(set (match_operand:CC 2 "cc_reg_operand" "=x")
+	(compare:CC (match_operand:SI 1 "gpc_reg_operand" "r")
+		    (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r") (match_dup 1))]
+  "! TARGET_POWERPC64"
+  "mr. %0,%1"
+  [(set_attr "type" "compare")])
+
+(define_expand "movhi"
+  [(set (match_operand:HI 0 "general_operand" "")
+	(match_operand:HI 1 "any_operand" ""))]
+  ""
+  "
+{
+  if (GET_CODE (operands[0]) != REG)
+    operands[1] = force_reg (HImode, operands[1]);
+
+  if (CONSTANT_P (operands[1])
+      && GET_CODE (operands[1]) != CONST_INT)
+    {
+      operands[1] = force_const_mem (HImode, operands[1]);
+      if (! memory_address_p (HImode, XEXP (operands[1], 0))
+	  && ! reload_in_progress)
+	operands[1] = change_address (operands[1], HImode,
+				      XEXP (operands[1], 0));
+    }
+}")
+
+(define_insn ""
+  [(set (match_operand:HI 0 "nonimmediate_operand" "=r,r,m,r,r,*q,*c*l,*h")
+	(match_operand:HI 1 "input_operand" "r,m,r,i,*h,r,r,0"))]
+  "gpc_reg_operand (operands[0], HImode)
+   || gpc_reg_operand (operands[1], HImode)"
+  "@
+   mr %0,%1
+   lhz%U1%X1 %0,%1
+   sth%U0%X0 %1,%0
+   {lil|li} %0,%w1
+   mf%1 %0
+   mt%0 %1
+   mt%0 %1
+   cror 0,0,0"
+  [(set_attr "type" "*,load,store,*,*,*,mtjmpr,*")])
+
+(define_expand "movqi"
+  [(set (match_operand:QI 0 "general_operand" "")
+	(match_operand:QI 1 "any_operand" ""))]
+  ""
+  "
+{
+  if (GET_CODE (operands[0]) != REG)
+    operands[1] = force_reg (QImode, operands[1]);
+
+  if (CONSTANT_P (operands[1])
+      && GET_CODE (operands[1]) != CONST_INT)
+    {
+      operands[1] = force_const_mem (QImode, operands[1]);
+      if (! memory_address_p (QImode, XEXP (operands[1], 0))
+	  && ! reload_in_progress)
+	operands[1] = change_address (operands[1], QImode,
+				      XEXP (operands[1], 0));
+    }
+}")
+
+(define_insn ""
+  [(set (match_operand:QI 0 "nonimmediate_operand" "=r,r,m,r,r,*q,*c*l,*h")
+	(match_operand:QI 1 "input_operand" "r,m,r,i,*h,r,r,0"))]
+  "gpc_reg_operand (operands[0], QImode)
+   || gpc_reg_operand (operands[1], QImode)"
+  "@
+   mr %0,%1
+   lbz%U1%X1 %0,%1
+   stb%U0%X0 %1,%0
+   {lil|li} %0,%1
+   mf%1 %0
+   mt%0 %1
+   mt%0 %1
+   cror 0,0,0"
+  [(set_attr "type" "*,load,store,*,*,*,mtjmpr,*")])
+
+;; Here is how to move condition codes around.  When we store CC data in
+;; an integer register or memory, we store just the high-order 4 bits.
+;; This lets us not shift in the most common case of CR0.
+(define_expand "movcc"
+  [(set (match_operand:CC 0 "nonimmediate_operand" "")
+	(match_operand:CC 1 "nonimmediate_operand" ""))]
+  ""
+  "")
+
+(define_insn ""
+  [(set (match_operand:CC 0 "nonimmediate_operand" "=y,x,y,r,r,r,r,m")
+	(match_operand:CC 1 "nonimmediate_operand" "y,r,r,x,y,r,m,r"))]
+  "register_operand (operands[0], CCmode)
+   || register_operand (operands[1], CCmode)"
+  "@
+   mcrf %0,%1
+   mtcrf 128,%1
+   {rlinm|rlwinm} %1,%1,%F0,0xffffffff\;mtcrf %R0,%1\;{rlinm|rlwinm} %1,%1,%f0,0xffffffff
+   mfcr %0
+   mfcr %0\;{rlinm|rlwinm} %0,%0,%f1,0xf0000000
+   mr %0,%1
+   {l%U1%X1|lwz%U1%X1} %0,%1
+   {st%U0%U1|stw%U0%U1} %1,%0"
+  [(set_attr "type" "*,*,*,compare,*,*,load,store")
+   (set_attr "length" "*,*,12,*,8,*,*,*")])
+
+;; For floating-point, we normally deal with the floating-point registers
+;; unless -msoft-float is used.  The sole exception is that parameter passing
+;; can produce floating-point values in fixed-point registers.  Unless the
+;; value is a simple constant or already in memory, we deal with this by
+;; allocating memory and copying the value explicitly via that memory location.
+(define_expand "movsf"
+  [(set (match_operand:SF 0 "nonimmediate_operand" "")
+	(match_operand:SF 1 "any_operand" ""))]
+  ""
+  "
+{
+  /* If we are called from reload, we might be getting a SUBREG of a hard
+     reg.  So expand it.  */
+  if (GET_CODE (operands[0]) == SUBREG
+      && GET_CODE (SUBREG_REG (operands[0])) == REG
+      && REGNO (SUBREG_REG (operands[0])) < FIRST_PSEUDO_REGISTER)
+    operands[0] = alter_subreg (operands[0]);
+  if (GET_CODE (operands[1]) == SUBREG
+      && GET_CODE (SUBREG_REG (operands[1])) == REG
+      && REGNO (SUBREG_REG (operands[1])) < FIRST_PSEUDO_REGISTER)
+    operands[1] = alter_subreg (operands[1]);
+
+  if (GET_CODE (operands[0]) == MEM)
+    {
+      /* If operands[1] is a register, it may have double-precision data
+	 in it, so truncate it to single precision.  We need not do
+	 this for POWERPC.  */
+      if (! TARGET_POWERPC && TARGET_HARD_FLOAT
+	  && GET_CODE (operands[1]) == REG
+	  && (FP_REGNO_P (REGNO (operands[1]))
+	      || REGNO (operands[1]) >= FIRST_PSEUDO_REGISTER))
+	{
+	  rtx newreg = (no_new_pseudos ? operands[1] : gen_reg_rtx (SFmode));
+	  emit_insn (gen_aux_truncdfsf2 (newreg, operands[1]));
+	  operands[1] = newreg;
+	}
+
+      operands[1] = force_reg (SFmode, operands[1]);
+    }
+
+  if (CONSTANT_P (operands[1]) && TARGET_HARD_FLOAT
+      && ! easy_fp_constant (operands[1], SFmode))
+    {
+      operands[1] = force_const_mem (SFmode, operands[1]);
+      if (! memory_address_p (SFmode, XEXP (operands[1], 0))
+	  && ! reload_in_progress)
+	operands[1] = change_address (operands[1], SFmode,
+				      XEXP (operands[1], 0));
+    }
+}")
+
+(define_split
+  [(set (match_operand:SF 0 "gpc_reg_operand" "")
+	(match_operand:SF 1 "const_double_operand" ""))]
+  "reload_completed
+   && ((GET_CODE (operands[0]) == REG && REGNO (operands[0]) <= 31)
+       || (GET_CODE (operands[0]) == SUBREG
+	   && GET_CODE (SUBREG_REG (operands[0])) == REG
+	   && REGNO (SUBREG_REG (operands[0])) <= 31))"
+  [(set (match_dup 2) (match_dup 3))]
+  "
+{
+  long l;
+  REAL_VALUE_TYPE rv;
+
+  REAL_VALUE_FROM_CONST_DOUBLE (rv, operands[1]);
+  REAL_VALUE_TO_TARGET_SINGLE (rv, l);
+
+  if (! TARGET_POWERPC64)
+    operands[2] = operand_subword (operands[0], 0, 0, SFmode);
+  else
+    operands[2] = gen_lowpart (SImode, operands[0]);
+
+  operands[3] = GEN_INT(l);
+}")
+
+(define_insn "*movsf_hardfloat"
+  [(set (match_operand:SF 0 "nonimmediate_operand" "=!r,!r,m,f,f,m,!r,!r")
+	(match_operand:SF 1 "input_operand" "r,m,r,f,m,f,G,Fn"))]
+  "(gpc_reg_operand (operands[0], SFmode)
+   || gpc_reg_operand (operands[1], SFmode)) && TARGET_HARD_FLOAT"
+  "@
+   mr %0,%1
+   {l%U1%X1|lwz%U1%X1} %0,%1
+   {st%U0%X0|stw%U0%X0} %1,%0
+   fmr %0,%1
+   lfs%U1%X1 %0,%1
+   stfs%U0%X0 %1,%0
+   #
+   #"
+  [(set_attr "type" "*,load,store,fp,fpload,fpstore,*,*")
+   (set_attr "length" "4,4,4,4,4,4,4,8")])
+
+(define_insn "*movsf_softfloat"
+  [(set (match_operand:SF 0 "nonimmediate_operand" "=r,r,m,r,r,r,r,r")
+	(match_operand:SF 1 "input_operand" "r,m,r,I,L,R,G,Fn"))]
+  "(gpc_reg_operand (operands[0], SFmode)
+   || gpc_reg_operand (operands[1], SFmode)) && TARGET_SOFT_FLOAT"
+  "@
+   mr %0,%1
+   {l%U1%X1|lwz%U1%X1} %0,%1
+   {st%U0%X0|stw%U0%X0} %1,%0
+   {lil|li} %0,%1
+   {liu|lis} %0,%v1
+   {cal|la} %0,%1(%*)
+   #
+   #"
+  [(set_attr "type" "*,load,store,*,*,*,*,*")
+   (set_attr "length" "4,4,4,4,4,4,4,8")])
+
+
+(define_expand "movdf"
+  [(set (match_operand:DF 0 "nonimmediate_operand" "")
+	(match_operand:DF 1 "any_operand" ""))]
+  ""
+  "
+{
+  if (GET_CODE (operands[0]) != REG)
+    operands[1] = force_reg (DFmode, operands[1]);
+
+  if (CONSTANT_P (operands[1]) && ! easy_fp_constant (operands[1], DFmode))
+    {
+      operands[1] = force_const_mem (DFmode, operands[1]);
+      if (! memory_address_p (DFmode, XEXP (operands[1], 0))
+	  && ! reload_in_progress)
+	operands[1] = change_address (operands[1], DFmode,
+				      XEXP (operands[1], 0));
+    }
+}")
+
+(define_split
+  [(set (match_operand:DF 0 "gpc_reg_operand" "")
+	(match_operand:DF 1 "const_int_operand" ""))]
+  "! TARGET_POWERPC64 && reload_completed
+   && ((GET_CODE (operands[0]) == REG && REGNO (operands[0]) <= 31)
+       || (GET_CODE (operands[0]) == SUBREG
+	   && GET_CODE (SUBREG_REG (operands[0])) == REG
+	   && REGNO (SUBREG_REG (operands[0])) <= 31))"
+  [(set (match_dup 2) (match_dup 4))
+   (set (match_dup 3) (match_dup 1))]
+  "
+{
+  int endian = (WORDS_BIG_ENDIAN == 0);
+  operands[2] = operand_subword (operands[0], endian, 0, DFmode);
+  operands[3] = operand_subword (operands[0], 1 - endian, 0, DFmode);
+  operands[4] = (INTVAL (operands[1]) & 0x80000000) ? constm1_rtx : const0_rtx;
+}")
+
+(define_split
+  [(set (match_operand:DF 0 "gpc_reg_operand" "")
+	(match_operand:DF 1 "const_double_operand" ""))]
+  "! TARGET_POWERPC64 && reload_completed
+   && ((GET_CODE (operands[0]) == REG && REGNO (operands[0]) <= 31)
+       || (GET_CODE (operands[0]) == SUBREG
+	   && GET_CODE (SUBREG_REG (operands[0])) == REG
+	   && REGNO (SUBREG_REG (operands[0])) <= 31))"
+  [(set (match_dup 2) (match_dup 4))
+   (set (match_dup 3) (match_dup 5))]
+  "
+{
+  int endian = (WORDS_BIG_ENDIAN == 0);
+  long l[2];
+  REAL_VALUE_TYPE rv;
+
+  REAL_VALUE_FROM_CONST_DOUBLE (rv, operands[1]);
+  REAL_VALUE_TO_TARGET_DOUBLE (rv, l);
+
+  operands[2] = operand_subword (operands[0], endian, 0, DFmode);
+  operands[3] = operand_subword (operands[0], 1 - endian, 0, DFmode);
+  operands[4] = GEN_INT (l[endian]);
+  operands[5] = GEN_INT (l[1 - endian]);
+}")
+
+(define_split
+  [(set (match_operand:DF 0 "gpc_reg_operand" "")
+	(match_operand:DF 1 "easy_fp_constant" ""))]
+  "TARGET_POWERPC64 && reload_completed
+   && ((GET_CODE (operands[0]) == REG && REGNO (operands[0]) <= 31)
+       || (GET_CODE (operands[0]) == SUBREG
+	   && GET_CODE (SUBREG_REG (operands[0])) == REG
+	   && REGNO (SUBREG_REG (operands[0])) <= 31))"
+  [(set (match_dup 2) (match_dup 3))]
+  "
+{
+  int endian = (WORDS_BIG_ENDIAN == 0);
+  long l[2];
+  REAL_VALUE_TYPE rv;
+
+  REAL_VALUE_FROM_CONST_DOUBLE (rv, operands[1]);
+  REAL_VALUE_TO_TARGET_DOUBLE (rv, l);
+
+  operands[2] = gen_lowpart (DImode, operands[0]);
+  /* HIGHPART is lower memory address when WORDS_BIG_ENDIAN.  */
+  operands[3] = immed_double_const (l[1 - endian], l[endian], DImode);
+}")
+
+;; Don't have reload use general registers to load a constant.  First,
+;; it might not work if the output operand is the equivalent of
+;; a non-offsettable memref, but also it is less efficient than loading
+;; the constant into an FP register, since it will probably be used there.
+;; The "??" is a kludge until we can figure out a more reasonable way
+;; of handling these non-offsettable values.
+(define_insn "*movdf_hardfloat32"
+  [(set (match_operand:DF 0 "nonimmediate_operand" "=!r,??r,m,!r,!r,!r,f,f,m")
+	(match_operand:DF 1 "input_operand" "r,m,r,G,H,F,f,m,f"))]
+  "! TARGET_POWERPC64 && TARGET_HARD_FLOAT
+   && (gpc_reg_operand (operands[0], DFmode)
+       || gpc_reg_operand (operands[1], DFmode))"
+  "*
+{
+  switch (which_alternative)
+    {
+    default:
+      abort ();
+    case 0:
+      /* We normally copy the low-numbered register first.  However, if
+	 the first register operand 0 is the same as the second register
+	 of operand 1, we must copy in the opposite order.  */
+      if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
+	return \"mr %L0,%L1\;mr %0,%1\";
+      else
+	return \"mr %0,%1\;mr %L0,%L1\";
+    case 1:
+      if (offsettable_memref_p (operands[1])
+	  || (GET_CODE (operands[1]) == MEM
+	      && (GET_CODE (XEXP (operands[1], 0)) == LO_SUM
+		  || GET_CODE (XEXP (operands[1], 0)) == PRE_INC
+		  || GET_CODE (XEXP (operands[1], 0)) == PRE_DEC)))
+	{
+	  /* If the low-address word is used in the address, we must load
+	     it last.  Otherwise, load it first.  Note that we cannot have
+	     auto-increment in that case since the address register is
+	     known to be dead.  */
+	  if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
+				 operands[1], 0))
+	    return \"{l|lwz} %L0,%L1\;{l|lwz} %0,%1\";
+	  else
+	    return \"{l%U1|lwz%U1} %0,%1\;{l|lwz} %L0,%L1\";
+	}
+      else
+	{
+	  rtx addreg;
+
+	  addreg = find_addr_reg (XEXP (operands[1], 0));
+	  if (refers_to_regno_p (REGNO (operands[0]),
+				 REGNO (operands[0]) + 1,
+				 operands[1], 0))
+	    {
+	      output_asm_insn (\"{cal|la} %0,4(%0)\", &addreg);
+	      output_asm_insn (\"{lx|lwzx} %L0,%1\", operands);
+	      output_asm_insn (\"{cal|la} %0,-4(%0)\", &addreg);
+	      return \"{lx|lwzx} %0,%1\";
+	    }
+	  else
+	    {
+	      output_asm_insn (\"{lx|lwzx} %0,%1\", operands);
+	      output_asm_insn (\"{cal|la} %0,4(%0)\", &addreg);
+	      output_asm_insn (\"{lx|lwzx} %L0,%1\", operands);
+	      output_asm_insn (\"{cal|la} %0,-4(%0)\", &addreg);
+	      return \"\";
+	    }
+	}
+    case 2:
+      if (offsettable_memref_p (operands[0])
+	  || (GET_CODE (operands[0]) == MEM
+	      && (GET_CODE (XEXP (operands[0], 0)) == LO_SUM
+		  || GET_CODE (XEXP (operands[0], 0)) == PRE_INC
+		  || GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)))
+	return \"{st%U0|stw%U0} %1,%0\;{st|stw} %L1,%L0\";
+      else
+	{
+	  rtx addreg;
+
+	  addreg = find_addr_reg (XEXP (operands[0], 0));
+	  output_asm_insn (\"{stx|stwx} %1,%0\", operands);
+	  output_asm_insn (\"{cal|la} %0,4(%0)\", &addreg);
+	  output_asm_insn (\"{stx|stwx} %L1,%0\", operands);
+	  output_asm_insn (\"{cal|la} %0,-4(%0)\", &addreg);
+	  return \"\";
+	}
+    case 3:
+    case 4:
+    case 5:
+      return \"#\";
+    case 6:
+      return \"fmr %0,%1\";
+    case 7:
+      return \"lfd%U1%X1 %0,%1\";
+    case 8:
+      return \"stfd%U0%X0 %1,%0\";
+    }
+}"
+  [(set_attr "type" "*,load,store,*,*,*,fp,fpload,fpstore")
+   (set_attr "length" "8,16,16,8,12,16,*,*,*")])
+
+(define_insn "*movdf_softfloat32"
+  [(set (match_operand:DF 0 "nonimmediate_operand" "=r,r,m,r,r,r")
+	(match_operand:DF 1 "input_operand" "r,m,r,G,H,F"))]
+  "! TARGET_POWERPC64 && TARGET_SOFT_FLOAT
+   && (gpc_reg_operand (operands[0], DFmode)
+       || gpc_reg_operand (operands[1], DFmode))"
+  "*
+{
+  switch (which_alternative)
+    {
+    default:
+      abort ();
+    case 0:
+      /* We normally copy the low-numbered register first.  However, if
+	 the first register operand 0 is the same as the second register of
+	 operand 1, we must copy in the opposite order.  */
+      if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
+	return \"mr %L0,%L1\;mr %0,%1\";
+      else
+	return \"mr %0,%1\;mr %L0,%L1\";
+    case 1:
+      /* If the low-address word is used in the address, we must load it
+	 last.  Otherwise, load it first.  Note that we cannot have
+	 auto-increment in that case since the address register is known to be
+	 dead.  */
+      if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
+			     operands [1], 0))
+	return \"{l|lwz} %L0,%L1\;{l|lwz} %0,%1\";
+      else
+	return \"{l%U1|lwz%U1} %0,%1\;{l|lwz} %L0,%L1\";
+    case 2:
+      return \"{st%U0|stw%U0} %1,%0\;{st|stw} %L1,%L0\";
+    case 3:
+    case 4:
+    case 5:
+      return \"#\";
+    }
+}"
+  [(set_attr "type" "*,load,store,*,*,*")
+   (set_attr "length" "8,8,8,8,12,16")])
+
+(define_insn "*movdf_hardfloat64"
+  [(set (match_operand:DF 0 "nonimmediate_operand" "=!r,??r,m,!r,!r,!r,f,f,m")
+	(match_operand:DF 1 "input_operand" "r,m,r,G,H,F,f,m,f"))]
+  "TARGET_POWERPC64 && TARGET_HARD_FLOAT
+   && (gpc_reg_operand (operands[0], DFmode)
+       || gpc_reg_operand (operands[1], DFmode))"
+  "@
+   mr %0,%1
+   ld%U1%X1 %0,%1
+   std%U0%X0 %1,%0
+   #
+   #
+   #
+   fmr %0,%1
+   lfd%U1%X1 %0,%1
+   stfd%U0%X0 %1,%0"
+  [(set_attr "type" "*,load,store,*,*,*,fp,fpload,fpstore")
+   (set_attr "length" "4,4,4,8,12,16,4,4,4")])
+
+(define_insn "*movdf_softfloat64"
+  [(set (match_operand:DF 0 "nonimmediate_operand" "=r,r,m,r,r,r")
+	(match_operand:DF 1 "input_operand" "r,m,r,G,H,F"))]
+  "TARGET_POWERPC64 && TARGET_SOFT_FLOAT
+   && (gpc_reg_operand (operands[0], DFmode)
+       || gpc_reg_operand (operands[1], DFmode))"
+  "@
+   mr %0,%1
+   ld%U1%X1 %0,%1
+   std%U0%X0 %1,%0
+   #
+   #
+   #"
+  [(set_attr "type" "*,load,store,*,*,*")
+   (set_attr "length" "*,*,*,8,12,16")])
+
+;; Next come the multi-word integer load and store and the load and store
+;; multiple insns.
+(define_expand "movdi"
+  [(set (match_operand:DI 0 "general_operand" "")
+	(match_operand:DI 1 "any_operand" ""))]
+  ""
+  "
+{
+  if (GET_CODE (operands[0]) != REG)
+    operands[1] = force_reg (DImode, operands[1]);
+
+  /* Convert a move of a CONST_DOUBLE into a CONST_INT
+     only if sign-extended lower-half for 32-bit host.  */
+  if (GET_CODE (operands[1]) == CONST_DOUBLE
+#if HOST_BITS_PER_WIDE_INT == 32
+      && ((CONST_DOUBLE_HIGH (operands[1]) == 0
+	   && (CONST_DOUBLE_LOW (operands[1]) & 0x80000000) == 0)
+	  || (CONST_DOUBLE_HIGH (operands[1]) == (HOST_WIDE_INT) 0xffffffff
+	      && (CONST_DOUBLE_LOW (operands[1]) & 0x80000000) != 0))
+#endif
+	 )
+    operands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1]));
+
+  /* Only a tiny bit of handling for CONSTANT_P_RTX is necessary.  */
+  if (GET_CODE (operands[1]) == CONSTANT_P_RTX)
+    {
+      emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
+      DONE;
+    }
+
+  if (TARGET_64BIT
+      && CONSTANT_P (operands[1])
+#if HOST_BITS_PER_WIDE_INT == 32
+      && GET_CODE (operands[1]) != CONST_INT
+#endif
+      && ! easy_fp_constant (operands[1], DImode)
+      && ! LEGITIMATE_CONSTANT_POOL_ADDRESS_P (operands[1]))
+    {
+      /* Emit a USE operation so that the constant isn't deleted if
+	 expensive optimizations are turned on because nobody
+	 references it.  This should only be done for operands that
+	 contain SYMBOL_REFs with CONSTANT_POOL_ADDRESS_P set.
+	 This should not be done for operands that contain LABEL_REFs.
+	 For now, we just handle the obvious case.  */
+      if (GET_CODE (operands[1]) != LABEL_REF)
+	emit_insn (gen_rtx_USE (VOIDmode, operands[1]));
+
+      /* If we are to limit the number of things we put in the TOC and
+	 this is a symbol plus a constant we can add in one insn,
+	 just put the symbol in the TOC and add the constant.  Don't do
+	 this if reload is in progress.  */
+      if (GET_CODE (operands[1]) == CONST
+	  && TARGET_NO_SUM_IN_TOC && ! reload_in_progress
+	  && GET_CODE (XEXP (operands[1], 0)) == PLUS
+	  && add_operand (XEXP (XEXP (operands[1], 0), 1), DImode)
+	  && (GET_CODE (XEXP (XEXP (operands[1], 0), 0)) == LABEL_REF
+	      || GET_CODE (XEXP (XEXP (operands[1], 0), 0)) == SYMBOL_REF)
+	  && ! side_effects_p (operands[0]))
+	{
+	  rtx sym = force_const_mem (DImode, XEXP (XEXP (operands[1], 0), 0));
+	  rtx other = XEXP (XEXP (operands[1], 0), 1);
+
+	  emit_insn (gen_adddi3 (operands[0], force_reg (DImode, sym), other));
+	  DONE;
+	}
+
+      operands[1] = force_const_mem (DImode, operands[1]);
+      if (! memory_address_p (DImode, XEXP (operands[1], 0))
+	  && ! reload_in_progress)
+	operands[1] = change_address (operands[1], DImode,
+				      XEXP (operands[1], 0));
+    }
+}")
+
+(define_insn "*movdi_32"
+  [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,m,f,f,m,r,r,r,r,r")
+	(match_operand:DI 1 "input_operand" "r,m,r,f,m,f,IJK,n,G,H,F"))]
+  "! TARGET_POWERPC64
+   && (gpc_reg_operand (operands[0], DImode)
+       || gpc_reg_operand (operands[1], DImode))"
+  "*
+{
+  switch (which_alternative)
+    {
+    default:
+      abort ();
+    case 0:
+      /* We normally copy the low-numbered register first.  However, if
+	 the first register operand 0 is the same as the second register of
+	 operand 1, we must copy in the opposite order.  */
+      if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
+	return \"mr %L0,%L1\;mr %0,%1\";
+      else
+	return \"mr %0,%1\;mr %L0,%L1\";
+    case 1:
+      /* If the low-address word is used in the address, we must load it
+	 last.  Otherwise, load it first.  Note that we cannot have
+	 auto-increment in that case since the address register is known to be
+	 dead.  */
+      if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
+			     operands [1], 0))
+	return \"{l|lwz} %L0,%L1\;{l|lwz} %0,%1\";
+      else
+	return \"{l%U1|lwz%U1} %0,%1\;{l|lwz} %L0,%L1\";
+    case 2:
+      return \"{st%U0|stw%U0} %1,%0\;{st|stw} %L1,%L0\";
+    case 3:
+      return \"fmr %0,%1\";
+    case 4:
+      return \"lfd%U1%X1 %0,%1\";
+    case 5:
+      return \"stfd%U0%X0 %1,%0\";
+    case 6:
+    case 7:
+    case 8:
+    case 9:
+    case 10:
+      return \"#\";
+    }
+}"
+  [(set_attr "type" "*,load,store,fp,fpload,fpstore,*,*,*,*,*")
+   (set_attr "length" "8,8,8,*,*,*,8,12,8,12,16")])
+
+(define_split
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+	(match_operand:DI 1 "const_int_operand" ""))]
+  "! TARGET_POWERPC64 && reload_completed"
+  [(set (match_dup 2) (match_dup 4))
+   (set (match_dup 3) (match_dup 1))]
+  "
+{
+  HOST_WIDE_INT value = INTVAL (operands[1]);
+  operands[2] = gen_rtx_SUBREG (SImode, operands[0], WORDS_BIG_ENDIAN == 0);
+  operands[3] = gen_rtx_SUBREG (SImode, operands[0], WORDS_BIG_ENDIAN != 0);
+#if HOST_BITS_PER_WIDE_INT == 32
+  operands[4] = (value & 0x80000000) ? constm1_rtx : const0_rtx;
+#else
+  operands[4] = GEN_INT (value >> 32);
+  operands[1] = GEN_INT ((value & 0x7fffffff) - (value & 0x80000000));
+#endif
+}")
+
+(define_split
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+	(match_operand:DI 1 "const_double_operand" ""))]
+  "HOST_BITS_PER_WIDE_INT == 32 && ! TARGET_POWERPC64 && reload_completed"
+  [(set (match_dup 2) (match_dup 4))
+   (set (match_dup 3) (match_dup 5))]
+  "
+{
+  operands[2] = gen_rtx_SUBREG (SImode, operands[0], WORDS_BIG_ENDIAN == 0);
+  operands[3] = gen_rtx_SUBREG (SImode, operands[0], WORDS_BIG_ENDIAN != 0);
+  operands[4] = GEN_INT (CONST_DOUBLE_HIGH (operands[1]));
+  operands[5] = GEN_INT (CONST_DOUBLE_LOW  (operands[1]));
+}")
+
+(define_insn "*movdi_64"
+  [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,m,r,r,r,r,f,f,m,r,*h,*h")
+	(match_operand:DI 1 "input_operand" "r,m,r,I,L,nF,R,f,m,f,*h,r,0"))]
+  "TARGET_POWERPC64
+   && (gpc_reg_operand (operands[0], DImode)
+       || gpc_reg_operand (operands[1], DImode))"
+  "@
+   mr %0,%1
+   ld%U1%X1 %0,%1
+   std%U0%X0 %1,%0
+   li %0,%1
+   lis %0,%v1
+   #
+   {cal|la} %0,%1(%*)
+   fmr %0,%1
+   lfd%U1%X1 %0,%1
+   stfd%U0%X0 %1,%0
+   mf%1 %0
+   mt%0 %1
+   cror 0,0,0"
+  [(set_attr "type" "*,load,store,*,*,*,*,fp,fpload,fpstore,*,mtjmpr,*")
+   (set_attr "length" "4,4,4,4,4,20,4,4,4,4,4,4,4")])
+
+(define_insn ""
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(match_operand:DI 1 "const_double_operand" "F"))]
+  "TARGET_POWERPC64 && GET_CODE (operands[1]) == CONST_DOUBLE
+   && num_insns_constant (operands[1], DImode) == 1"
+  "*
+{
+  return ((unsigned HOST_WIDE_INT)
+	  (CONST_DOUBLE_LOW (operands[1]) + 0x8000) < 0x10000)
+	 ? \"li %0,%1\" : \"lis %0,%v1\";
+}")
+
+(define_split
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+	(match_operand:DI 1 "const_int_operand" ""))]
+  "HOST_BITS_PER_WIDE_INT == 32 && TARGET_POWERPC64
+   && num_insns_constant (operands[1], DImode) > 1"
+  [(set (match_dup 0)
+	(match_dup 2))
+   (set (match_dup 0)
+	(ior:DI (match_dup 0)
+		(match_dup 3)))]
+  "
+{
+  operands[2] = GEN_INT (INTVAL (operands[1]) & 0xffff0000);
+  operands[3] = GEN_INT (INTVAL (operands[1]) & 0xffff);
+}")
+
+(define_split
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+	(match_operand:DI 1 "const_double_operand" ""))]
+  "HOST_BITS_PER_WIDE_INT == 32 && TARGET_POWERPC64
+   && GET_CODE (operands[1]) == CONST_DOUBLE
+   && ((CONST_DOUBLE_HIGH (operands[1]) == 0
+        && (CONST_DOUBLE_LOW (operands[1]) & 0x80000000) == 0)
+       || (CONST_DOUBLE_HIGH (operands[1]) == (HOST_WIDE_INT) 0xffffffff
+           && (CONST_DOUBLE_LOW (operands[1]) & 0x80000000) != 0))"
+  [(set (match_dup 0)
+	(match_dup 2))
+   (set (match_dup 0)
+	(ior:DI (match_dup 0)
+		(match_dup 3)))]
+  "
+{
+  operands[2] = GEN_INT (CONST_DOUBLE_LOW (operands[1]) & 0xffff0000);
+  operands[3] = GEN_INT (CONST_DOUBLE_LOW (operands[1]) & 0xffff);
+}")
+
+(define_split
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+	(match_operand:DI 1 "const_double_operand" ""))]
+  "HOST_BITS_PER_WIDE_INT == 32 && TARGET_POWERPC64
+   && GET_CODE (operands[1]) == CONST_DOUBLE
+   && CONST_DOUBLE_HIGH (operands[1]) == 0
+   && (CONST_DOUBLE_LOW (operands[1]) & 0x80000000) != 0"
+  [(set (match_dup 0)
+	(match_dup 2))
+   (set (match_dup 0)
+	(zero_extend:DI (match_dup 3)))]
+  "
+{ 
+  operands[2] = GEN_INT (CONST_DOUBLE_LOW (operands[1])); 
+  operands[3] = gen_lowpart_common (SImode, operands[0]);
+}")
+
+(define_split
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+	(match_operand:DI 1 "const_double_operand" ""))]
+  "HOST_BITS_PER_WIDE_INT == 32 && TARGET_POWERPC64
+   && GET_CODE (operands[1]) == CONST_DOUBLE
+   && CONST_DOUBLE_LOW (operands[1]) == 0"
+  [(set (match_dup 0)
+	(match_dup 2))
+   (set (match_dup 0)
+	(ashift:DI (match_dup 0)
+		   (const_int 32)))]
+  "
+{ operands[2] = GEN_INT (CONST_DOUBLE_HIGH (operands[1])); }")
+
+;; Generate all one-bits and clear left or right.
+;; Use (and:DI (rotate:DI ...)) to avoid anddi3 unnecessary clobber.
+(define_split
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+	(match_operand:DI 1 "mask64_operand" ""))]
+  "TARGET_POWERPC64 && num_insns_constant (operands[1], DImode) > 1"
+  [(set (match_dup 0) (const_int -1))
+   (set (match_dup 0)
+	(and:DI (rotate:DI (match_dup 0)
+			   (const_int 0))
+		(match_dup 1)))]
+  "")
+
+;; Split a load of a large constant into the appropriate five-instruction
+;; sequence.  Handle anything in a constant number of insns.
+;; When non-easy constants can go in the TOC, this should use
+;; easy_fp_constant predicate.
+(define_split
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+	(match_operand:DI 1 "const_double_operand" ""))]
+  "HOST_BITS_PER_WIDE_INT == 32 && TARGET_POWERPC64
+   && num_insns_constant (operands[1], DImode) > 1"
+  [(set (match_dup 0)
+	(match_dup 2))
+   (set (match_dup 0)
+	(ashift:DI (match_dup 0)
+		   (const_int 32)))
+   (set (match_dup 0)
+	(ior:DI (match_dup 0)
+		(match_dup 3)))]
+  "
+{
+  if (GET_CODE (operands[1]) == CONST_DOUBLE)
+    {
+      operands[2] = GEN_INT (CONST_DOUBLE_HIGH (operands[1]));
+      operands[3] = immed_double_const (CONST_DOUBLE_LOW (operands[1]),
+					0, DImode);
+    }
+  else
+    {
+      HOST_WIDE_INT value = INTVAL (operands[1]);
+      operands[2] = (value & 0x80000000) ? constm1_rtx : const0_rtx;
+      operands[3] = immed_double_const (value, 0, DImode);
+    }
+}")
+
+(define_split
+  [(set (match_operand:DI 0 "gpc_reg_operand" "")
+	(match_operand:DI 1 "const_int_operand" ""))]
+  "HOST_BITS_PER_WIDE_INT != 32 && TARGET_POWERPC64
+   && num_insns_constant (operands[1], DImode) > 1"
+  [(set (match_dup 0)
+	(match_dup 2))
+   (set (match_dup 0)
+	(ashift:DI (match_dup 0)
+		   (const_int 32)))
+   (set (match_dup 0)
+	(ior:DI (match_dup 0)
+		(match_dup 3)))]
+  "
+{
+#if HOST_BITS_PER_WIDE_INT != 32
+  HOST_WIDE_INT value = INTVAL (operands[1]);
+  operands[2] = GEN_INT (value >> 32);
+  operands[3] = GEN_INT ((value & 0x7fffffff) - (value & 0x80000000));
+#endif
+}")
+
+(define_insn ""
+  [(set (match_operand:CC 2 "cc_reg_operand" "=x")
+	(compare:CC (match_operand:DI 1 "gpc_reg_operand" "r")
+		    (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r") (match_dup 1))]
+  "TARGET_POWERPC64"
+  "mr. %0,%1"
+  [(set_attr "type" "compare")])
+
+;; TImode is similar, except that we usually want to compute the address into
+;; a register and use lsi/stsi (the exception is during reload).  MQ is also
+;; clobbered in stsi for POWER, so we need a SCRATCH for it.
+(define_expand "movti"
+  [(parallel [(set (match_operand:TI 0 "general_operand" "")
+		   (match_operand:TI 1 "general_operand" ""))
+	      (clobber (scratch:SI))])]
+  "TARGET_STRING || TARGET_POWERPC64"
+  "
+{
+  if (GET_CODE (operands[0]) == MEM)
+    operands[1] = force_reg (TImode, operands[1]);
+
+  if (GET_CODE (operands[0]) == MEM
+      && GET_CODE (XEXP (operands[0], 0)) != REG
+      && ! reload_in_progress)
+    operands[0] = change_address (operands[0], TImode,
+				  copy_addr_to_reg (XEXP (operands[0], 0)));
+
+  if (GET_CODE (operands[1]) == MEM
+      && GET_CODE (XEXP (operands[1], 0)) != REG
+      && ! reload_in_progress)
+    operands[1] = change_address (operands[1], TImode,
+				  copy_addr_to_reg (XEXP (operands[1], 0)));
+}")
+
+;; We say that MQ is clobbered in the last alternative because the first
+;; alternative would never get used otherwise since it would need a reload
+;; while the 2nd alternative would not.  We put memory cases first so they
+;; are preferred.  Otherwise, we'd try to reload the output instead of
+;; giving the SCRATCH mq.
+(define_insn "*movti_power"
+  [(set (match_operand:TI 0 "reg_or_mem_operand" "=Q,m,????r,????r,????r")
+	(match_operand:TI 1 "reg_or_mem_operand" "r,r,r,Q,m"))
+   (clobber (match_scratch:SI 2 "=q,q#X,X,X,X"))]
+  "TARGET_STRING && TARGET_POWER && ! TARGET_POWERPC64
+   && (gpc_reg_operand (operands[0], TImode) || gpc_reg_operand (operands[1], TImode))"
+  "*
+{
+  switch (which_alternative)
+    {
+    default:
+      abort ();
+
+    case 0:
+      return \"{stsi|stswi} %1,%P0,16\";
+
+    case 1:
+      return \"{st%U0|stw%U0} %1,%0\;{st|stw} %L1,%L0\;{st|stw} %Y1,%Y0\;{st|stw} %Z1,%Z0\";
+
+    case 2:
+      /* Normally copy registers with lowest numbered register copied first.
+	 But copy in the other order if the first register of the output
+	 is the second, third, or fourth register in the input.  */
+      if (REGNO (operands[0]) >= REGNO (operands[1]) + 1
+	  && REGNO (operands[0]) <= REGNO (operands[1]) + 3)
+	return \"mr %Z0,%Z1\;mr %Y0,%Y1\;mr %L0,%L1\;mr %0,%1\";
+      else
+	return \"mr %0,%1\;mr %L0,%L1\;mr %Y0,%Y1\;mr %Z0,%Z1\";
+    case 3:
+      /* If the address is not used in the output, we can use lsi.  Otherwise,
+	 fall through to generating four loads.  */
+      if (! reg_overlap_mentioned_p (operands[0], operands[1]))
+	return \"{lsi|lswi} %0,%P1,16\";
+      /* ... fall through ... */
+    case 4:
+      /* If the address register is the same as the register for the lowest-
+	 addressed word, load it last.  Similarly for the next two words.
+	 Otherwise load lowest address to highest.  */
+      if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
+			     operands[1], 0))
+	return \"{l|lwz} %L0,%L1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1\;{l|lwz} %0,%1\";
+      else if (refers_to_regno_p (REGNO (operands[0]) + 1,
+				  REGNO (operands[0]) + 2, operands[1], 0))
+	return \"{l|lwz} %0,%1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1\;{l|lwz} %L0,%L1\";
+      else if (refers_to_regno_p (REGNO (operands[0]) + 2,
+				  REGNO (operands[0]) + 3, operands[1], 0))
+	return \"{l|lwz} %0,%1\;{l|lwz} %L0,%L1\;{l|lwz} %Z0,%Z1\;{l|lwz} %Y0,%Y1\";
+      else
+	return \"{l%U1|lwz%U1} %0,%1\;{l|lwz} %L0,%L1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1\";
+    }
+}"
+  [(set_attr "type" "store,store,*,load,load")
+   (set_attr "length" "*,16,16,*,16")])
+
+(define_insn "*movti_string"
+  [(set (match_operand:TI 0 "reg_or_mem_operand" "=m,????r,????r")
+	(match_operand:TI 1 "reg_or_mem_operand" "r,r,m"))
+   (clobber (match_scratch:SI 2 "=X,X,X"))]
+  "TARGET_STRING && ! TARGET_POWER && ! TARGET_POWERPC64
+   && (gpc_reg_operand (operands[0], TImode) || gpc_reg_operand (operands[1], TImode))"
+  "*
+{
+  switch (which_alternative)
+    {
+    default:
+      abort ();
+
+    case 0:
+      return \"{st%U0|stw%U0} %1,%0\;{st|stw} %L1,%L0\;{st|stw} %Y1,%Y0\;{st|stw} %Z1,%Z0\";
+
+    case 1:
+      /* Normally copy registers with lowest numbered register copied first.
+	 But copy in the other order if the first register of the output
+	 is the second, third, or fourth register in the input.  */
+      if (REGNO (operands[0]) >= REGNO (operands[1]) + 1
+	  && REGNO (operands[0]) <= REGNO (operands[1]) + 3)
+	return \"mr %Z0,%Z1\;mr %Y0,%Y1\;mr %L0,%L1\;mr %0,%1\";
+      else
+	return \"mr %0,%1\;mr %L0,%L1\;mr %Y0,%Y1\;mr %Z0,%Z1\";
+    case 2:
+      /* If the address register is the same as the register for the lowest-
+	 addressed word, load it last.  Similarly for the next two words.
+	 Otherwise load lowest address to highest.  */
+      if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
+			     operands[1], 0))
+	return \"{l|lwz} %L0,%L1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1\;{l|lwz} %0,%1\";
+      else if (refers_to_regno_p (REGNO (operands[0]) + 1,
+				  REGNO (operands[0]) + 2, operands[1], 0))
+	return \"{l|lwz} %0,%1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1\;{l|lwz} %L0,%L1\";
+      else if (refers_to_regno_p (REGNO (operands[0]) + 2,
+				  REGNO (operands[0]) + 3, operands[1], 0))
+	return \"{l|lwz} %0,%1\;{l|lwz} %L0,%L1\;{l|lwz} %Z0,%Z1\;{l|lwz} %Y0,%Y1\";
+      else
+	return \"{l%U1|lwz%U1} %0,%1\;{l|lwz} %L0,%L1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1\";
+    }
+}"
+  [(set_attr "type" "store,*,load")
+   (set_attr "length" "16,16,16")])
+
+(define_insn "*movti_ppc64"
+  [(set (match_operand:TI 0 "nonimmediate_operand" "=r,r,m")
+	(match_operand:TI 1 "input_operand" "r,m,r"))]
+  "TARGET_POWERPC64 && (gpc_reg_operand (operands[0], TImode)
+   || gpc_reg_operand (operands[1], TImode))"
+  "*
+{
+  switch (which_alternative)
+    {
+    default:
+      abort ();
+    case 0:
+      /* We normally copy the low-numbered register first.  However, if
+	 the first register operand 0 is the same as the second register of
+	 operand 1, we must copy in the opposite order.  */
+      if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
+	return \"mr %L0,%L1\;mr %0,%1\";
+      else
+	return \"mr %0,%1\;mr %L0,%L1\";
+    case 1:
+      /* If the low-address word is used in the address, we must load it
+	 last.  Otherwise, load it first.  Note that we cannot have
+	 auto-increment in that case since the address register is known to be
+	 dead.  */
+      if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
+			     operands [1], 0))
+	return \"ld %L0,%L1\;ld %0,%1\";
+      else
+	return \"ld%U1 %0,%1\;ld %L0,%L1\";
+    case 2:
+      return \"std%U0 %1,%0\;std %L1,%L0\";
+    }
+}"
+  [(set_attr "type" "*,load,store")
+   (set_attr "length" "8,8,8")])
+
+(define_expand "load_multiple"
+  [(match_par_dup 3 [(set (match_operand:SI 0 "" "")
+			  (match_operand:SI 1 "" ""))
+		     (use (match_operand:SI 2 "" ""))])]
+  "TARGET_STRING"
+  "
+{
+  int regno;
+  int count;
+  rtx from;
+  int i;
+
+  /* Support only loading a constant number of fixed-point registers from
+     memory and only bother with this if more than two; the machine
+     doesn't support more than eight.  */
+  if (GET_CODE (operands[2]) != CONST_INT
+      || INTVAL (operands[2]) <= 2
+      || INTVAL (operands[2]) > 8
+      || GET_CODE (operands[1]) != MEM
+      || GET_CODE (operands[0]) != REG
+      || REGNO (operands[0]) >= 32)
+    FAIL;
+
+  count = INTVAL (operands[2]);
+  regno = REGNO (operands[0]);
+
+  operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
+  from = force_reg (SImode, XEXP (operands[1], 0));
+
+  for (i = 0; i < count; i++)
+    XVECEXP (operands[3], 0, i)
+      = gen_rtx_SET (VOIDmode, gen_rtx_REG (SImode, regno + i),
+		 change_address (operands[1], SImode,
+				 plus_constant (from, i * 4)));
+}")
+
+(define_insn ""
+  [(match_parallel 0 "load_multiple_operation"
+		   [(set (match_operand:SI 1 "gpc_reg_operand" "=r")
+			 (mem:SI (match_operand:SI 2 "gpc_reg_operand" "b")))])]
+  "TARGET_STRING"
+  "*
+{
+  /* We have to handle the case where the pseudo used to contain the address
+     is assigned to one of the output registers.  */
+  int i, j;
+  int words = XVECLEN (operands[0], 0);
+  rtx xop[10];
+
+  if (XVECLEN (operands[0], 0) == 1)
+    return \"{l|lwz} %1,0(%2)\";
+
+  for (i = 0; i < words; i++)
+    if (refers_to_regno_p (REGNO (operands[1]) + i,
+			   REGNO (operands[1]) + i + 1, operands[2], 0))
+      {
+	if (i == words-1)
+	  {
+	    xop[0] = operands[1];
+	    xop[1] = operands[2];
+	    xop[2] = GEN_INT (4 * (words-1));
+	    output_asm_insn (\"{lsi|lswi} %0,%1,%2\;{l|lwz} %1,%2(%1)\", xop);
+	    return \"\";
+	  }
+	else if (i == 0)
+	  {
+	    xop[0] = operands[1];
+	    xop[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
+	    xop[2] = GEN_INT (4 * (words-1));
+	    output_asm_insn (\"{cal %0,4(%0)|addi %0,%0,4}\;{lsi|lswi} %1,%0,%2\;{l|lwz} %0,-4(%0)\", xop);
+	    return \"\";
+	  }
+	else
+	  {
+	    for (j = 0; j < words; j++)
+	      if (j != i)
+		{
+		  xop[0] = gen_rtx_REG (SImode, REGNO (operands[1]) + j);
+		  xop[1] = operands[2];
+		  xop[2] = GEN_INT (j * 4);
+		  output_asm_insn (\"{l|lwz} %0,%2(%1)\", xop);
+		}
+	    xop[0] = operands[2];
+	    xop[1] = GEN_INT (i * 4);
+	    output_asm_insn (\"{l|lwz} %0,%1(%0)\", xop);
+	    return \"\";
+	  }
+      }
+
+  return \"{lsi|lswi} %1,%2,%N0\";
+}"
+  [(set_attr "type" "load")
+   (set_attr "length" "32")])
+
+
+(define_expand "store_multiple"
+  [(match_par_dup 3 [(set (match_operand:SI 0 "" "")
+			  (match_operand:SI 1 "" ""))
+		     (clobber (scratch:SI))
+		     (use (match_operand:SI 2 "" ""))])]
+  "TARGET_STRING"
+  "
+{
+  int regno;
+  int count;
+  rtx to;
+  int i;
+
+  /* Support only storing a constant number of fixed-point registers to
+     memory and only bother with this if more than two; the machine
+     doesn't support more than eight.  */
+  if (GET_CODE (operands[2]) != CONST_INT
+      || INTVAL (operands[2]) <= 2
+      || INTVAL (operands[2]) > 8
+      || GET_CODE (operands[0]) != MEM
+      || GET_CODE (operands[1]) != REG
+      || REGNO (operands[1]) >= 32)
+    FAIL;
+
+  count = INTVAL (operands[2]);
+  regno = REGNO (operands[1]);
+
+  operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count + 1));
+  to = force_reg (SImode, XEXP (operands[0], 0));
+
+  XVECEXP (operands[3], 0, 0)
+    = gen_rtx_SET (VOIDmode, change_address (operands[0], SImode, to),
+	       operands[1]);
+  XVECEXP (operands[3], 0, 1) = gen_rtx_CLOBBER (VOIDmode,
+						  gen_rtx_SCRATCH (SImode));
+
+  for (i = 1; i < count; i++)
+    XVECEXP (operands[3], 0, i + 1)
+      = gen_rtx_SET (VOIDmode,
+		 change_address (operands[0], SImode,
+				 plus_constant (to, i * 4)),
+		 gen_rtx_REG (SImode, regno + i));
+}")
+
+(define_insn ""
+  [(match_parallel 0 "store_multiple_operation"
+		   [(set (match_operand:SI 1 "indirect_operand" "=Q")
+			 (match_operand:SI 2 "gpc_reg_operand" "r"))
+		    (clobber (match_scratch:SI 3 "=q"))])]
+  "TARGET_STRING && TARGET_POWER"
+  "{stsi|stswi} %2,%P1,%O0"
+  [(set_attr "type" "store")])
+
+(define_insn ""
+  [(match_parallel 0 "store_multiple_operation"
+		   [(set (mem:SI (match_operand:SI 1 "gpc_reg_operand" "b"))
+			 (match_operand:SI 2 "gpc_reg_operand" "r"))
+		    (clobber (match_scratch:SI 3 "X"))])]
+  "TARGET_STRING && ! TARGET_POWER"
+  "{stsi|stswi} %2,%1,%O0"
+  [(set_attr "type" "store")])
+
+
+;; String/block move insn.
+;; Argument 0 is the destination
+;; Argument 1 is the source
+;; Argument 2 is the length
+;; Argument 3 is the alignment
+
+(define_expand "movstrsi"
+  [(parallel [(set (match_operand:BLK 0 "" "")
+		   (match_operand:BLK 1 "" ""))
+	      (use (match_operand:SI 2 "" ""))
+	      (use (match_operand:SI 3 "" ""))])]
+  ""
+  "
+{
+  if (expand_block_move (operands))
+    DONE;
+  else
+    FAIL;
+}")
+
+;; Move up to 32 bytes at a time.  The fixed registers are needed because the
+;; register allocator doesn't have a clue about allocating 8 word registers
+(define_expand "movstrsi_8reg"
+  [(parallel [(set (match_operand 0 "" "")
+		   (match_operand 1 "" ""))
+	      (use (match_operand 2 "" ""))
+	      (use (match_operand 3 "" ""))
+	      (clobber (reg:SI  5))
+	      (clobber (reg:SI  6))
+	      (clobber (reg:SI  7))
+	      (clobber (reg:SI  8))
+	      (clobber (reg:SI  9))
+	      (clobber (reg:SI 10))
+	      (clobber (reg:SI 11))
+	      (clobber (reg:SI 12))
+	      (clobber (match_scratch:SI 4 ""))])]
+  "TARGET_STRING"
+  "")
+
+(define_insn ""
+  [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
+	(mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
+   (use (match_operand:SI 2 "immediate_operand" "i"))
+   (use (match_operand:SI 3 "immediate_operand" "i"))
+   (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
+   (clobber (reg:SI  6))
+   (clobber (reg:SI  7))
+   (clobber (reg:SI  8))
+   (clobber (reg:SI  9))
+   (clobber (reg:SI 10))
+   (clobber (reg:SI 11))
+   (clobber (reg:SI 12))
+   (clobber (match_scratch:SI 5 "=q"))]
+  "TARGET_STRING && TARGET_POWER
+   && ((INTVAL (operands[2]) > 24 && INTVAL (operands[2]) < 32) || INTVAL (operands[2]) == 0)
+   && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 12)
+   && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 12)
+   && REGNO (operands[4]) == 5"
+  "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
+  [(set_attr "type" "load")
+   (set_attr "length" "8")])
+
+(define_insn ""
+  [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
+	(mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
+   (use (match_operand:SI 2 "immediate_operand" "i"))
+   (use (match_operand:SI 3 "immediate_operand" "i"))
+   (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
+   (clobber (reg:SI  6))
+   (clobber (reg:SI  7))
+   (clobber (reg:SI  8))
+   (clobber (reg:SI  9))
+   (clobber (reg:SI 10))
+   (clobber (reg:SI 11))
+   (clobber (reg:SI 12))
+   (clobber (match_scratch:SI 5 "X"))]
+  "TARGET_STRING && ! TARGET_POWER
+   && ((INTVAL (operands[2]) > 24 && INTVAL (operands[2]) < 32) || INTVAL (operands[2]) == 0)
+   && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 12)
+   && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 12)
+   && REGNO (operands[4]) == 5"
+  "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
+  [(set_attr "type" "load")
+   (set_attr "length" "8")])
+
+;; Move up to 24 bytes at a time.  The fixed registers are needed because the
+;; register allocator doesn't have a clue about allocating 6 word registers
+(define_expand "movstrsi_6reg"
+  [(parallel [(set (match_operand 0 "" "")
+		   (match_operand 1 "" ""))
+	      (use (match_operand 2 "" ""))
+	      (use (match_operand 3 "" ""))
+	      (clobber (reg:SI  7))
+	      (clobber (reg:SI  8))
+	      (clobber (reg:SI  9))
+	      (clobber (reg:SI 10))
+	      (clobber (reg:SI 11))
+	      (clobber (reg:SI 12))
+	      (clobber (match_scratch:SI 4 ""))])]
+  "TARGET_STRING"
+  "")
+
+(define_insn ""
+  [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
+	(mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
+   (use (match_operand:SI 2 "immediate_operand" "i"))
+   (use (match_operand:SI 3 "immediate_operand" "i"))
+   (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
+   (clobber (reg:SI  8))
+   (clobber (reg:SI  9))
+   (clobber (reg:SI 10))
+   (clobber (reg:SI 11))
+   (clobber (reg:SI 12))
+   (clobber (match_scratch:SI 5 "=q"))]
+  "TARGET_STRING && TARGET_POWER
+   && INTVAL (operands[2]) > 16 && INTVAL (operands[2]) <= 24
+   && (REGNO (operands[0]) < 7 || REGNO (operands[0]) > 12)
+   && (REGNO (operands[1]) < 7 || REGNO (operands[1]) > 12)
+   && REGNO (operands[4]) == 7"
+  "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
+  [(set_attr "type" "load")
+   (set_attr "length" "8")])
+
+(define_insn ""
+  [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
+	(mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
+   (use (match_operand:SI 2 "immediate_operand" "i"))
+   (use (match_operand:SI 3 "immediate_operand" "i"))
+   (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
+   (clobber (reg:SI  8))
+   (clobber (reg:SI  9))
+   (clobber (reg:SI 10))
+   (clobber (reg:SI 11))
+   (clobber (reg:SI 12))
+   (clobber (match_scratch:SI 5 "X"))]
+  "TARGET_STRING && ! TARGET_POWER
+   && INTVAL (operands[2]) > 16 && INTVAL (operands[2]) <= 32
+   && (REGNO (operands[0]) < 7 || REGNO (operands[0]) > 12)
+   && (REGNO (operands[1]) < 7 || REGNO (operands[1]) > 12)
+   && REGNO (operands[4]) == 7"
+  "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
+  [(set_attr "type" "load")
+   (set_attr "length" "8")])
+
+;; Move up to 16 bytes at a time, using 4 fixed registers to avoid spill problems
+;; with TImode
+(define_expand "movstrsi_4reg"
+  [(parallel [(set (match_operand 0 "" "")
+		   (match_operand 1 "" ""))
+	      (use (match_operand 2 "" ""))
+	      (use (match_operand 3 "" ""))
+	      (clobber (reg:SI  9))
+	      (clobber (reg:SI 10))
+	      (clobber (reg:SI 11))
+	      (clobber (reg:SI 12))
+	      (clobber (match_scratch:SI 4 ""))])]
+  "TARGET_STRING"
+  "")
+
+(define_insn ""
+  [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
+	(mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
+   (use (match_operand:SI 2 "immediate_operand" "i"))
+   (use (match_operand:SI 3 "immediate_operand" "i"))
+   (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
+   (clobber (reg:SI 10))
+   (clobber (reg:SI 11))
+   (clobber (reg:SI 12))
+   (clobber (match_scratch:SI 5 "=q"))]
+  "TARGET_STRING && TARGET_POWER
+   && INTVAL (operands[2]) > 8 && INTVAL (operands[2]) <= 16
+   && (REGNO (operands[0]) < 9 || REGNO (operands[0]) > 12)
+   && (REGNO (operands[1]) < 9 || REGNO (operands[1]) > 12)
+   && REGNO (operands[4]) == 9"
+  "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
+  [(set_attr "type" "load")
+   (set_attr "length" "8")])
+
+(define_insn ""
+  [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
+	(mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
+   (use (match_operand:SI 2 "immediate_operand" "i"))
+   (use (match_operand:SI 3 "immediate_operand" "i"))
+   (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
+   (clobber (reg:SI 10))
+   (clobber (reg:SI 11))
+   (clobber (reg:SI 12))
+   (clobber (match_scratch:SI 5 "X"))]
+  "TARGET_STRING && ! TARGET_POWER
+   && INTVAL (operands[2]) > 8 && INTVAL (operands[2]) <= 16
+   && (REGNO (operands[0]) < 9 || REGNO (operands[0]) > 12)
+   && (REGNO (operands[1]) < 9 || REGNO (operands[1]) > 12)
+   && REGNO (operands[4]) == 9"
+  "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
+  [(set_attr "type" "load")
+   (set_attr "length" "8")])
+
+;; Move up to 8 bytes at a time.
+(define_expand "movstrsi_2reg"
+  [(parallel [(set (match_operand 0 "" "")
+		   (match_operand 1 "" ""))
+	      (use (match_operand 2 "" ""))
+	      (use (match_operand 3 "" ""))
+	      (clobber (match_scratch:DI 4 ""))
+	      (clobber (match_scratch:SI 5 ""))])]
+  "TARGET_STRING && ! TARGET_64BIT"
+  "")
+
+(define_insn ""
+  [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
+	(mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
+   (use (match_operand:SI 2 "immediate_operand" "i"))
+   (use (match_operand:SI 3 "immediate_operand" "i"))
+   (clobber (match_scratch:DI 4 "=&r"))
+   (clobber (match_scratch:SI 5 "=q"))]
+  "TARGET_STRING && TARGET_POWER && ! TARGET_64BIT
+   && INTVAL (operands[2]) > 4 && INTVAL (operands[2]) <= 8"
+  "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
+  [(set_attr "type" "load")
+   (set_attr "length" "8")])
+
+(define_insn ""
+  [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
+	(mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
+   (use (match_operand:SI 2 "immediate_operand" "i"))
+   (use (match_operand:SI 3 "immediate_operand" "i"))
+   (clobber (match_scratch:DI 4 "=&r"))
+   (clobber (match_scratch:SI 5 "X"))]
+  "TARGET_STRING && ! TARGET_POWER && ! TARGET_64BIT
+   && INTVAL (operands[2]) > 4 && INTVAL (operands[2]) <= 8"
+  "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
+  [(set_attr "type" "load")
+   (set_attr "length" "8")])
+
+;; Move up to 4 bytes at a time.
+(define_expand "movstrsi_1reg"
+  [(parallel [(set (match_operand 0 "" "")
+		   (match_operand 1 "" ""))
+	      (use (match_operand 2 "" ""))
+	      (use (match_operand 3 "" ""))
+	      (clobber (match_scratch:SI 4 ""))
+	      (clobber (match_scratch:SI 5 ""))])]
+  "TARGET_STRING"
+  "")
+
+(define_insn ""
+  [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
+	(mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
+   (use (match_operand:SI 2 "immediate_operand" "i"))
+   (use (match_operand:SI 3 "immediate_operand" "i"))
+   (clobber (match_scratch:SI 4 "=&r"))
+   (clobber (match_scratch:SI 5 "=q"))]
+  "TARGET_STRING && TARGET_POWER
+   && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) <= 4"
+  "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
+  [(set_attr "type" "load")
+   (set_attr "length" "8")])
+
+(define_insn ""
+  [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
+	(mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
+   (use (match_operand:SI 2 "immediate_operand" "i"))
+   (use (match_operand:SI 3 "immediate_operand" "i"))
+   (clobber (match_scratch:SI 4 "=&r"))
+   (clobber (match_scratch:SI 5 "X"))]
+  "TARGET_STRING && ! TARGET_POWER
+   && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) <= 4"
+  "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
+  [(set_attr "type" "load")
+   (set_attr "length" "8")])
+
+
+;; Define insns that do load or store with update.  Some of these we can
+;; get by using pre-decrement or pre-increment, but the hardware can also
+;; do cases where the increment is not the size of the object.
+;;
+;; In all these cases, we use operands 0 and 1 for the register being
+;; incremented because those are the operands that local-alloc will
+;; tie and these are the pair most likely to be tieable (and the ones
+;; that will benefit the most).
+
+(define_insn "*movdi_update1"
+  [(set (match_operand:DI 3 "gpc_reg_operand" "=r,r")
+	(mem:DI (plus:DI (match_operand:DI 1 "gpc_reg_operand" "0,0")
+			 (match_operand:DI 2 "reg_or_short_operand" "r,I"))))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=b,b")
+	(plus:DI (match_dup 1) (match_dup 2)))]
+  "TARGET_POWERPC64 && TARGET_UPDATE"
+  "@
+   ldux %3,%0,%2
+   ldu %3,%2(%0)"
+  [(set_attr "type" "load")])
+
+(define_insn "*movdi_update2"
+  [(set (match_operand:DI 3 "gpc_reg_operand" "=r")
+	(sign_extend:DI
+	 (mem:SI (plus:DI (match_operand:DI 1 "gpc_reg_operand" "0")
+			  (match_operand:DI 2 "gpc_reg_operand" "r")))))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=b")
+	(plus:DI (match_dup 1) (match_dup 2)))]
+  "TARGET_POWERPC64"
+  "lwaux %3,%0,%2"
+  [(set_attr "type" "load")])
+
+(define_insn "movdi_update"
+  [(set (mem:DI (plus:DI (match_operand:DI 1 "gpc_reg_operand" "0,0")
+			 (match_operand:DI 2 "reg_or_short_operand" "r,I")))
+	(match_operand:DI 3 "gpc_reg_operand" "r,r"))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=b,b")
+	(plus:DI (match_dup 1) (match_dup 2)))]
+  "TARGET_POWERPC64 && TARGET_UPDATE"
+  "@
+   stdux %3,%0,%2
+   stdu %3,%2(%0)"
+  [(set_attr "type" "store")])
+
+(define_insn "*movsi_update1"
+  [(set (match_operand:SI 3 "gpc_reg_operand" "=r,r")
+	(mem:SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
+			 (match_operand:SI 2 "reg_or_short_operand" "r,I"))))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
+	(plus:SI (match_dup 1) (match_dup 2)))]
+  ""
+  "@
+   {lux|lwzux} %3,%0,%2
+   {lu|lwzu} %3,%2(%0)"
+  [(set_attr "type" "load")])
+
+(define_insn "movsi_update"
+  [(set (mem:SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
+			 (match_operand:SI 2 "reg_or_short_operand" "r,I")))
+	(match_operand:SI 3 "gpc_reg_operand" "r,r"))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
+	(plus:SI (match_dup 1) (match_dup 2)))]
+  "TARGET_UPDATE"
+  "@
+   {stux|stwux} %3,%0,%2
+   {stu|stwu} %3,%2(%0)"
+  [(set_attr "type" "store")])
+
+(define_insn "*movhi_update"
+  [(set (match_operand:HI 3 "gpc_reg_operand" "=r,r")
+	(mem:HI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
+			 (match_operand:SI 2 "reg_or_short_operand" "r,I"))))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
+	(plus:SI (match_dup 1) (match_dup 2)))]
+  "TARGET_UPDATE"
+  "@
+   lhzux %3,%0,%2
+   lhzu %3,%2(%0)"
+  [(set_attr "type" "load")])
+
+(define_insn "*movhi_update2"
+  [(set (match_operand:SI 3 "gpc_reg_operand" "=r,r")
+	(zero_extend:SI
+	 (mem:HI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
+			  (match_operand:SI 2 "reg_or_short_operand" "r,I")))))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
+	(plus:SI (match_dup 1) (match_dup 2)))]
+  "TARGET_UPDATE"
+  "@
+   lhzux %3,%0,%2
+   lhzu %3,%2(%0)"
+  [(set_attr "type" "load")])
+
+(define_insn "*movhi_update3"
+  [(set (match_operand:SI 3 "gpc_reg_operand" "=r,r")
+	(sign_extend:SI
+	 (mem:HI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
+			  (match_operand:SI 2 "reg_or_short_operand" "r,I")))))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
+	(plus:SI (match_dup 1) (match_dup 2)))]
+  "TARGET_UPDATE"
+  "@
+   lhaux %3,%0,%2
+   lhau %3,%2(%0)"
+  [(set_attr "type" "load")])
+
+(define_insn "*movhi_update4"
+  [(set (mem:HI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
+			 (match_operand:SI 2 "reg_or_short_operand" "r,I")))
+	(match_operand:HI 3 "gpc_reg_operand" "r,r"))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
+	(plus:SI (match_dup 1) (match_dup 2)))]
+  "TARGET_UPDATE"
+  "@
+   sthux %3,%0,%2
+   sthu %3,%2(%0)"
+  [(set_attr "type" "store")])
+
+(define_insn "*movqi_update1"
+  [(set (match_operand:QI 3 "gpc_reg_operand" "=r,r")
+	(mem:QI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
+			 (match_operand:SI 2 "reg_or_short_operand" "r,I"))))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
+	(plus:SI (match_dup 1) (match_dup 2)))]
+  "TARGET_UPDATE"
+  "@
+   lbzux %3,%0,%2
+   lbzu %3,%2(%0)"
+  [(set_attr "type" "load")])
+
+(define_insn "*movqi_update2"
+  [(set (match_operand:SI 3 "gpc_reg_operand" "=r,r")
+	(zero_extend:SI
+	 (mem:QI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
+			  (match_operand:SI 2 "reg_or_short_operand" "r,I")))))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
+	(plus:SI (match_dup 1) (match_dup 2)))]
+  "TARGET_UPDATE"
+  "@
+   lbzux %3,%0,%2
+   lbzu %3,%2(%0)"
+  [(set_attr "type" "load")])
+
+(define_insn "*movqi_update3"
+  [(set (mem:QI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
+			 (match_operand:SI 2 "reg_or_short_operand" "r,I")))
+	(match_operand:QI 3 "gpc_reg_operand" "r,r"))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
+	(plus:SI (match_dup 1) (match_dup 2)))]
+  "TARGET_UPDATE"
+  "@
+   stbux %3,%0,%2
+   stbu %3,%2(%0)"
+  [(set_attr "type" "store")])
+
+(define_insn "*movsf_update1"
+  [(set (match_operand:SF 3 "gpc_reg_operand" "=f,f")
+	(mem:SF (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
+			 (match_operand:SI 2 "reg_or_short_operand" "r,I"))))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
+	(plus:SI (match_dup 1) (match_dup 2)))]
+  "TARGET_HARD_FLOAT && TARGET_UPDATE"
+  "@
+   lfsux %3,%0,%2
+   lfsu %3,%2(%0)"
+  [(set_attr "type" "fpload")])
+
+(define_insn "*movsf_update2"
+  [(set (mem:SF (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
+			 (match_operand:SI 2 "reg_or_short_operand" "r,I")))
+	(match_operand:SF 3 "gpc_reg_operand" "f,f"))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
+	(plus:SI (match_dup 1) (match_dup 2)))]
+  "TARGET_HARD_FLOAT && TARGET_UPDATE"
+  "@
+   stfsux %3,%0,%2
+   stfsu %3,%2(%0)"
+  [(set_attr "type" "fpstore")])
+
+(define_insn "*movsf_update3"
+  [(set (match_operand:SF 3 "gpc_reg_operand" "=r,r")
+	(mem:SF (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
+			 (match_operand:SI 2 "reg_or_short_operand" "r,I"))))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
+	(plus:SI (match_dup 1) (match_dup 2)))]
+  "TARGET_SOFT_FLOAT && TARGET_UPDATE"
+  "@
+   {lux|lwzux} %3,%0,%2
+   {lu|lwzu} %3,%2(%0)"
+  [(set_attr "type" "load")])
+
+(define_insn "*movsf_update4"
+  [(set (mem:SF (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
+			 (match_operand:SI 2 "reg_or_short_operand" "r,I")))
+	(match_operand:SF 3 "gpc_reg_operand" "r,r"))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
+	(plus:SI (match_dup 1) (match_dup 2)))]
+  "TARGET_SOFT_FLOAT && TARGET_UPDATE"
+  "@
+   {stux|stwux} %3,%0,%2
+   {stu|stwu} %3,%2(%0)"
+  [(set_attr "type" "store")])
+
+(define_insn "*movdf_update1"
+  [(set (match_operand:DF 3 "gpc_reg_operand" "=f,f")
+	(mem:DF (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
+			 (match_operand:SI 2 "reg_or_short_operand" "r,I"))))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
+	(plus:SI (match_dup 1) (match_dup 2)))]
+  "TARGET_HARD_FLOAT && TARGET_UPDATE"
+  "@
+   lfdux %3,%0,%2
+   lfdu %3,%2(%0)"
+  [(set_attr "type" "fpload")])
+
+(define_insn "*movdf_update2"
+  [(set (mem:DF (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
+			 (match_operand:SI 2 "reg_or_short_operand" "r,I")))
+	(match_operand:DF 3 "gpc_reg_operand" "f,f"))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
+	(plus:SI (match_dup 1) (match_dup 2)))]
+  "TARGET_HARD_FLOAT && TARGET_UPDATE"
+  "@
+   stfdux %3,%0,%2
+   stfdu %3,%2(%0)"
+  [(set_attr "type" "fpstore")])
+
+;; Peephole to convert two consecutive FP loads or stores into lfq/stfq.
+
+(define_peephole
+  [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
+	(match_operand:DF 1 "memory_operand" ""))
+   (set (match_operand:DF 2 "gpc_reg_operand" "=f")
+	(match_operand:DF 3 "memory_operand" ""))]
+  "TARGET_POWER2
+   && TARGET_HARD_FLOAT
+   && registers_ok_for_quad_peep (operands[0], operands[2])
+   && ! MEM_VOLATILE_P (operands[1]) && ! MEM_VOLATILE_P (operands[3])
+   && addrs_ok_for_quad_peep (XEXP (operands[1], 0), XEXP (operands[3], 0))"
+  "lfq%U1%X1 %0,%1")
+
+(define_peephole
+  [(set (match_operand:DF 0 "memory_operand" "")
+	(match_operand:DF 1 "gpc_reg_operand" "f"))
+   (set (match_operand:DF 2 "memory_operand" "")
+	(match_operand:DF 3 "gpc_reg_operand" "f"))]
+  "TARGET_POWER2
+   && TARGET_HARD_FLOAT
+   && registers_ok_for_quad_peep (operands[1], operands[3])
+   && ! MEM_VOLATILE_P (operands[0]) && ! MEM_VOLATILE_P (operands[2])
+   && addrs_ok_for_quad_peep (XEXP (operands[0], 0), XEXP (operands[2], 0))"
+  "stfq%U0%X0 %1,%0")
+
+;; Next come insns related to the calling sequence.
+;;
+;; First, an insn to allocate new stack space for dynamic use (e.g., alloca).
+;; We move the back-chain and decrement the stack pointer.
+
+(define_expand "allocate_stack"
+  [(set (match_operand 0 "gpc_reg_operand" "=r")
+	(minus (reg 1) (match_operand 1 "reg_or_short_operand" "")))
+   (set (reg 1)
+	(minus (reg 1) (match_dup 1)))]
+  ""
+  "
+{ rtx chain = gen_reg_rtx (Pmode);
+  rtx stack_bot = gen_rtx_MEM (Pmode, stack_pointer_rtx);
+  rtx neg_op0;
+
+  emit_move_insn (chain, stack_bot);
+
+  /* Under Windows NT, we need to add stack probes for large/variable
+     allocations, so do it via a call to the external function alloca
+     instead of doing it inline.  */
+  if (DEFAULT_ABI == ABI_NT
+      && (GET_CODE (operands[1]) != CONST_INT || INTVAL (operands[1]) > 4096))
+    {
+      rtx tmp = gen_reg_rtx (Pmode);
+      emit_library_call_value (gen_rtx_SYMBOL_REF (Pmode, \"__allocate_stack\"),
+			       tmp, 0, Pmode, 1, operands[1], Pmode);
+      emit_insn (gen_set_sp (tmp));
+      emit_move_insn (operands[0], tmp);
+      DONE;
+    }
+
+  if (GET_CODE (operands[1]) != CONST_INT
+      || INTVAL (operands[1]) < -32767
+      || INTVAL (operands[1]) > 32768)
+    {
+      neg_op0 = gen_reg_rtx (Pmode);
+      if (TARGET_32BIT)
+	emit_insn (gen_negsi2 (neg_op0, operands[1]));
+      else
+	emit_insn (gen_negdi2 (neg_op0, operands[1]));
+    }
+  else
+    neg_op0 = GEN_INT (- INTVAL (operands[1]));
+
+  if (TARGET_UPDATE)
+    emit_insn ((* ((TARGET_32BIT) ? gen_movsi_update : gen_movdi_update))
+		(stack_pointer_rtx, stack_pointer_rtx, neg_op0, chain));
+
+  else
+    {
+      emit_insn ((* ((TARGET_32BIT) ? gen_addsi3 : gen_adddi3))
+		 (stack_pointer_rtx, stack_pointer_rtx, neg_op0));
+      emit_move_insn (gen_rtx_MEM (Pmode, stack_pointer_rtx), chain);
+    }
+
+  emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
+  DONE;
+}")
+
+;; Marker to indicate that the stack pointer was changed under NT in
+;; ways not known to the compiler
+
+(define_insn "set_sp"
+  [(set (reg:SI 1)
+	(unspec [(match_operand:SI 0 "register_operand" "r")] 7))]
+  ""
+  ""
+  [(set_attr "length" "0")])
+
+;; These patterns say how to save and restore the stack pointer.  We need not
+;; save the stack pointer at function level since we are careful to
+;; preserve the backchain.  At block level, we have to restore the backchain
+;; when we restore the stack pointer.
+;;
+;; For nonlocal gotos, we must save both the stack pointer and its
+;; backchain and restore both.  Note that in the nonlocal case, the
+;; save area is a memory location.
+
+(define_expand "save_stack_function"
+  [(match_operand 0 "any_operand" "")
+   (match_operand 1 "any_operand" "")]
+  ""
+  "DONE;")
+
+(define_expand "restore_stack_function"
+  [(match_operand 0 "any_operand" "")
+   (match_operand 1 "any_operand" "")]
+  ""
+  "DONE;")
+
+(define_expand "restore_stack_block"
+  [(use (match_operand 0 "register_operand" ""))
+   (set (match_dup 2) (match_dup 3))
+   (set (match_dup 0) (match_operand 1 "register_operand" ""))
+   (set (match_dup 3) (match_dup 2))]
+  ""
+  "
+{
+  operands[2] = gen_reg_rtx (Pmode);
+  operands[3] = gen_rtx_MEM (Pmode, operands[0]);
+}")
+
+(define_expand "save_stack_nonlocal"
+  [(match_operand 0 "memory_operand" "")
+   (match_operand 1 "register_operand" "")]
+  ""
+  "
+{
+  rtx temp = gen_reg_rtx (Pmode);
+
+  /* Copy the backchain to the first word, sp to the second.  */
+  emit_move_insn (temp, gen_rtx_MEM (Pmode, operands[1]));
+  emit_move_insn (operand_subword (operands[0], 0, 0, (TARGET_32BIT ? DImode : TImode)),
+		  temp);
+  emit_move_insn (operand_subword (operands[0], 1, 0, (TARGET_32BIT ? DImode : TImode)),
+		  operands[1]);
+  DONE;
+}")
+
+(define_expand "restore_stack_nonlocal"
+  [(match_operand 0 "register_operand" "")
+   (match_operand 1 "memory_operand" "")]
+  ""
+  "
+{
+  rtx temp = gen_reg_rtx (Pmode);
+
+  /* Restore the backchain from the first word, sp from the second.  */
+  emit_move_insn (temp,
+		  operand_subword (operands[1], 0, 0, (TARGET_32BIT ? DImode : TImode)));
+  emit_move_insn (operands[0],
+		  operand_subword (operands[1], 1, 0, (TARGET_32BIT ? DImode : TImode)));
+  emit_move_insn (gen_rtx_MEM (Pmode, operands[0]), temp);
+  DONE;
+}")
+
+;; If we have -mminimal-toc, we need to reload r30 after a nonlocal goto.
+
+(define_insn "nonlocal_goto_receiver"
+  [(unspec_volatile [(const_int 0)] 1)]
+  "TARGET_TOC && TARGET_MINIMAL_TOC"
+  "*
+{
+  rs6000_output_load_toc_table (asm_out_file, 30);
+  return \"\";
+}"
+  [(set_attr "type" "load")
+   (set_attr "length" "24")])
+
+;; A function pointer under AIX is a pointer to a data area whose first word
+;; contains the actual address of the function, whose second word contains a
+;; pointer to its TOC, and whose third word contains a value to place in the
+;; static chain register (r11).  Note that if we load the static chain, our
+;; "trampoline" need not have any executable code.
+;;
+;; operands[0] is a register pointing to the 3 word descriptor (aka, the function address)
+;; operands[1] is the stack size to clean up
+;; operands[2] is the value FUNCTION_ARG returns for the VOID argument (must be 0 for AIX)
+;; operands[3] is location to store the TOC
+;; operands[4] is the TOC register
+;; operands[5] is the static chain register
+;;
+;; We do not break this into separate insns, so that the scheduler will not try
+;; to move the load of the new TOC before any loads from the TOC.
+
+(define_insn "call_indirect_aix32"
+  [(call (mem:SI (match_operand:SI 0 "gpc_reg_operand" "b"))
+	 (match_operand 1 "const_int_operand" "n"))
+   (use (match_operand 2 "const_int_operand" "n"))
+   (use (match_operand 3 "offsettable_mem_operand" "o"))
+   (use (match_operand 4 "gpc_reg_operand" "r"))
+   (clobber (match_operand 5 "gpc_reg_operand" "=r"))
+   (clobber (match_scratch:SI 6 "=&r"))
+   (clobber (match_scratch:SI 7 "=l"))]
+  "DEFAULT_ABI == ABI_AIX
+   && (INTVAL (operands[2]) == CALL_NORMAL || (INTVAL (operands[2]) & CALL_LONG) != 0)"
+  "{st|stw} %4,%3\;{l|lwz} %6,0(%0)\;{l|lwz} %4,4(%0)\;mt%7 %6\;{l|lwz} %5,8(%0)\;{brl|blrl}\;{l|lwz} %4,%3"
+  [(set_attr "type" "load")
+   (set_attr "length" "28")])
+
+(define_insn "call_indirect_aix64"
+  [(call (mem:SI (match_operand:DI 0 "gpc_reg_operand" "b"))
+	 (match_operand 1 "const_int_operand" "n"))
+   (use (match_operand 2 "const_int_operand" "n"))
+   (use (match_operand 3 "offsettable_mem_operand" "o"))
+   (use (match_operand 4 "gpc_reg_operand" "r"))
+   (clobber (match_operand 5 "gpc_reg_operand" "=r"))
+   (clobber (match_scratch:SI 6 "=&r"))
+   (clobber (match_scratch:SI 7 "=l"))]
+  "TARGET_64BIT && DEFAULT_ABI == ABI_AIX
+   && (INTVAL (operands[2]) == CALL_NORMAL || (INTVAL (operands[2]) & CALL_LONG) != 0)"
+  "std %4,%3\;ld %6,0(%0)\;ld %4,8(%0)\;mt%7 %6\;ld %5,16(%0)\;blrl\;ld %4,%3"
+  [(set_attr "type" "load")
+   (set_attr "length" "28")])
+
+(define_insn "call_value_indirect_aix32"
+  [(set (match_operand 0 "register_operand" "fg")
+	(call (mem:SI (match_operand:SI 1 "gpc_reg_operand" "b"))
+	      (match_operand 2 "const_int_operand" "n")))
+   (use (match_operand 3 "const_int_operand" "n"))
+   (use (match_operand 4 "offsettable_mem_operand" "o"))
+   (use (match_operand 5 "gpc_reg_operand" "r"))
+   (clobber (match_operand 6 "gpc_reg_operand" "=r"))
+   (clobber (match_scratch:SI 7 "=&r"))
+   (clobber (match_scratch:SI 8 "=l"))]
+  "DEFAULT_ABI == ABI_AIX
+   && (INTVAL (operands[3]) == CALL_NORMAL || (INTVAL (operands[3]) & CALL_LONG) != 0)"
+  "{st|stw} %5,%4\;{l|lwz} %7,0(%1)\;{l|lwz} %5,4(%1)\;mt%8 %7\;{l|lwz} %6,8(%1)\;{brl|blrl}\;{l|lwz} %5,%4"
+  [(set_attr "type" "load")
+   (set_attr "length" "28")])
+
+(define_insn "call_value_indirect_aix64"
+  [(set (match_operand 0 "register_operand" "fg")
+	(call (mem:SI (match_operand:DI 1 "gpc_reg_operand" "b"))
+	      (match_operand 2 "const_int_operand" "n")))
+   (use (match_operand 3 "const_int_operand" "n"))
+   (use (match_operand 4 "offsettable_mem_operand" "o"))
+   (use (match_operand 5 "gpc_reg_operand" "r"))
+   (clobber (match_operand 6 "gpc_reg_operand" "=r"))
+   (clobber (match_scratch:SI 7 "=&r"))
+   (clobber (match_scratch:SI 8 "=l"))]
+  "TARGET_64BIT && DEFAULT_ABI == ABI_AIX
+   && (INTVAL (operands[3]) == CALL_NORMAL || (INTVAL (operands[3]) & CALL_LONG) != 0)"
+  "std %5,%4\;ld %7,0(%1)\;ld %5,8(%1)\;mt%8 %7\;ld %6,16(%1)\;blrl\;ld %5,%4"
+  [(set_attr "type" "load")
+   (set_attr "length" "28")])
+
+;; A function pointer undef NT is a pointer to a data area whose first word
+;; contains the actual address of the function, whose second word contains a
+;; pointer to its TOC.  The static chain is not stored under NT, which means
+;; that we need a trampoline.
+;;
+;; operands[0] is an SImode pseudo in which we place the address of the function.
+;; operands[1] is the stack size to clean up
+;; operands[2] is the value FUNCTION_ARG returns for the VOID argument (must be 0 for NT)
+;; operands[3] is location to store the TOC
+;; operands[4] is the TOC register
+;;
+;; We do not break this into separate insns, so that the scheduler will not try
+;; to move the load of the new TOC before any loads from the TOC.
+
+(define_insn "call_indirect_nt"
+  [(call (mem:SI (match_operand:SI 0 "gpc_reg_operand" "b"))
+	 (match_operand 1 "const_int_operand" "n"))
+   (use (match_operand 2 "const_int_operand" "n"))
+   (use (match_operand 3 "offsettable_mem_operand" "o"))
+   (use (match_operand 4 "gpc_reg_operand" "r"))
+   (clobber (match_scratch:SI 5 "=&r"))
+   (clobber (match_scratch:SI 6 "=l"))]
+  "DEFAULT_ABI == ABI_NT
+   && (INTVAL (operands[2]) == CALL_NORMAL || (INTVAL (operands[2]) & CALL_LONG) != 0)"
+  "{st|stw} %4,%a3\;{l|lwz} %5,0(%0)\;{l|lwz} %4,4(%0)\;mt%6 %5\;{brl|blrl}\;{l|lwz} %4,%a3"
+  [(set_attr "type" "load")
+   (set_attr "length" "24")])
+
+(define_insn "call_value_indirect_nt"
+  [(set (match_operand 0 "register_operand" "fg")
+	(call (mem:SI (match_operand:SI 1 "gpc_reg_operand" "b"))
+	      (match_operand 2 "const_int_operand" "n")))
+   (use (match_operand 3 "const_int_operand" "n"))
+   (use (match_operand 4 "offsettable_mem_operand" "o"))
+   (use (match_operand 5 "gpc_reg_operand" "r"))
+   (clobber (match_scratch:SI 6 "=&r"))
+   (clobber (match_scratch:SI 7 "=l"))]
+  "DEFAULT_ABI == ABI_NT
+   && (INTVAL (operands[3]) == CALL_NORMAL || (INTVAL (operands[3]) & CALL_LONG) != 0)"
+  "{st|stw} %5,%a4\;{l|lwz} %6,0(%1)\;{l|lwz} %5,4(%1)\;mt%7 %6\;{brl|blrl}\;{l|lwz} %5,%a4"
+  [(set_attr "type" "load")
+   (set_attr "length" "24")])
+
+;; A function pointer under System V is just a normal pointer
+;; operands[0] is the function pointer
+;; operands[1] is the stack size to clean up
+;; operands[2] is the value FUNCTION_ARG returns for the VOID argument which indicates how to set cr1
+
+(define_insn "call_indirect_sysv"
+  [(call (mem:SI (match_operand:SI 0 "register_operand" "l,l"))
+	 (match_operand 1 "const_int_operand" "n,n"))
+   (use (match_operand 2 "const_int_operand" "O,n"))
+   (clobber (match_scratch:SI 3 "=l,l"))]
+  "DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS || DEFAULT_ABI == ABI_AIX_NODESC"
+  "*
+{
+  if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS)
+    output_asm_insn (\"crxor 6,6,6\", operands);
+
+  else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
+    output_asm_insn (\"creqv 6,6,6\", operands);
+
+  return \"{brl|blrl}\";
+}"
+  [(set_attr "type" "jmpreg")
+   (set_attr "length" "4,8")])
+
+(define_insn "call_value_indirect_sysv"
+  [(set (match_operand 0 "register_operand" "=fg,fg")
+	(call (mem:SI (match_operand:SI 1 "register_operand" "l,l"))
+	      (match_operand 2 "const_int_operand" "n,n")))
+   (use (match_operand 3 "const_int_operand" "O,n"))
+   (clobber (match_scratch:SI 4 "=l,l"))]
+  "DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS || DEFAULT_ABI == ABI_AIX_NODESC"
+  "*
+{
+  if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS)
+    output_asm_insn (\"crxor 6,6,6\", operands);
+
+  else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS)
+    output_asm_insn (\"creqv 6,6,6\", operands);
+
+  return \"{brl|blrl}\";
+}"
+  [(set_attr "type" "jmpreg")
+   (set_attr "length" "4,8")])
+
+;; Now the definitions for the call and call_value insns
+(define_expand "call"
+  [(parallel [(call (mem:SI (match_operand 0 "address_operand" ""))
+		    (match_operand 1 "" ""))
+	      (use (match_operand 2 "" ""))
+	      (clobber (scratch:SI))])]
+  ""
+  "
+{
+  if (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != CONST_INT)
+    abort ();
+
+  operands[0] = XEXP (operands[0], 0);
+
+  /* Convert NT DLL imports into an indirect call.  */
+  if (GET_CODE (operands[0]) == SYMBOL_REF
+      && (INTVAL (operands[2]) & CALL_NT_DLLIMPORT) != 0)
+    {
+      operands[0] = rs6000_dll_import_ref (operands[0]);
+      operands[2] = GEN_INT ((int)CALL_NORMAL);
+    }
+
+  if (GET_CODE (operands[0]) != SYMBOL_REF
+      || (INTVAL (operands[2]) & CALL_LONG) != 0)
+    {
+      if (INTVAL (operands[2]) & CALL_LONG)
+	operands[0] = rs6000_longcall_ref (operands[0]);
+
+      if (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_AIX_NODESC || DEFAULT_ABI == ABI_SOLARIS)
+	emit_call_insn (gen_call_indirect_sysv (force_reg (Pmode, operands[0]),
+						operands[1], operands[2]));
+      else
+	{
+	  rtx toc_reg = gen_rtx_REG (Pmode, 2);
+	  rtx toc_addr = RS6000_SAVE_TOC;
+
+	  if (DEFAULT_ABI == ABI_AIX)
+	    {
+	      /* AIX function pointers are really pointers to a three word area */
+	      rtx static_chain = gen_rtx_REG (Pmode, STATIC_CHAIN_REGNUM);
+	      emit_call_insn (TARGET_32BIT
+			      ? gen_call_indirect_aix32 (force_reg (Pmode, operands[0]),
+						         operands[1], operands[2],
+						         toc_addr, toc_reg, static_chain)
+			      : gen_call_indirect_aix64 (force_reg (Pmode, operands[0]),
+						         operands[1], operands[2],
+						         toc_addr, toc_reg, static_chain));
+	    }
+	  else if (DEFAULT_ABI == ABI_NT)
+	    {
+	      /* NT function pointers are really pointers to a two word area */
+	      emit_call_insn (gen_call_indirect_nt (force_reg (Pmode, operands[0]),
+						    operands[1], operands[2],
+						    toc_addr, toc_reg));
+	    }
+	  else
+	    abort ();
+	}
+      DONE;
+    }
+}")
+
+(define_expand "call_value"
+  [(parallel [(set (match_operand 0 "" "")
+		   (call (mem:SI (match_operand 1 "address_operand" ""))
+			 (match_operand 2 "" "")))
+	      (use (match_operand 3 "" ""))
+	      (clobber (scratch:SI))])]
+  ""
+  "
+{
+  if (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != CONST_INT)
+    abort ();
+
+  operands[1] = XEXP (operands[1], 0);
+
+  /* Convert NT DLL imports into an indirect call.  */
+  if (GET_CODE (operands[1]) == SYMBOL_REF
+      && (INTVAL (operands[3]) & CALL_NT_DLLIMPORT) != 0)
+    {
+      operands[1] = rs6000_dll_import_ref (operands[1]);
+      operands[3] = GEN_INT ((int)CALL_NORMAL);
+    }
+
+  if (GET_CODE (operands[1]) != SYMBOL_REF
+      || (INTVAL (operands[3]) & CALL_LONG) != 0)
+    {
+      if (INTVAL (operands[3]) & CALL_LONG)
+	operands[1] = rs6000_longcall_ref (operands[1]);
+
+      if (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_AIX_NODESC || DEFAULT_ABI == ABI_SOLARIS)
+	emit_call_insn (gen_call_value_indirect_sysv (operands[0], operands[1],
+						      operands[2], operands[3]));
+      else
+	{
+	  rtx toc_reg = gen_rtx_REG (Pmode, 2);
+	  rtx toc_addr = RS6000_SAVE_TOC;
+
+	  if (DEFAULT_ABI == ABI_AIX)
+	    {
+	      /* AIX function pointers are really pointers to a three word area */
+	      rtx static_chain = gen_rtx_REG (Pmode, STATIC_CHAIN_REGNUM);
+	      emit_call_insn (TARGET_32BIT
+			      ? gen_call_value_indirect_aix32 (operands[0],
+							       force_reg (Pmode, operands[1]),
+							       operands[2], operands[3],
+							       toc_addr, toc_reg, static_chain)
+			      : gen_call_value_indirect_aix64 (operands[0],
+							       force_reg (Pmode, operands[1]),
+							       operands[2], operands[3],
+							       toc_addr, toc_reg, static_chain));
+	    }
+	  else if (DEFAULT_ABI == ABI_NT)
+	    {
+	      /* NT function pointers are really pointers to a two word area */
+	      emit_call_insn (gen_call_value_indirect_nt (operands[0],
+							  force_reg (Pmode, operands[1]),
+							  operands[2], operands[3],
+							  toc_addr, toc_reg));
+	    }
+	  else
+	    abort ();
+	}
+      DONE;
+    }
+}")
+
+;; Call to function in current module.  No TOC pointer reload needed.
+;; Operand2 is non-zero if we are using the V.4 calling sequence and
+;; either the function was not prototyped, or it was prototyped as a
+;; variable argument function.  It is > 0 if FP registers were passed
+;; and < 0 if they were not.
+
+(define_insn "*call_local32"
+  [(call (mem:SI (match_operand:SI 0 "current_file_function_operand" "s,s"))
+	 (match_operand 1 "" "g,g"))
+   (use (match_operand:SI 2 "immediate_operand" "O,n"))
+   (clobber (match_scratch:SI 3 "=l,l"))]
+  "(INTVAL (operands[2]) & CALL_LONG) == 0"
+  "*
+{
+  if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS)
+    output_asm_insn (\"crxor 6,6,6\", operands);
+
+  else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
+    output_asm_insn (\"creqv 6,6,6\", operands);
+
+  return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"bl %z0@local\" : \"bl %z0\";
+}"
+  [(set_attr "type" "branch")
+   (set_attr "length" "4,8")])
+
+(define_insn "*call_local64"
+  [(call (mem:SI (match_operand:DI 0 "current_file_function_operand" "s,s"))
+	 (match_operand 1 "" "g,g"))
+   (use (match_operand:SI 2 "immediate_operand" "O,n"))
+   (clobber (match_scratch:SI 3 "=l,l"))]
+  "TARGET_64BIT && (INTVAL (operands[2]) & CALL_LONG) == 0"
+  "*
+{
+  if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS)
+    output_asm_insn (\"crxor 6,6,6\", operands);
+
+  else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
+    output_asm_insn (\"creqv 6,6,6\", operands);
+
+  return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"bl %z0@local\" : \"bl %z0\";
+}"
+  [(set_attr "type" "branch")
+   (set_attr "length" "4,8")])
+
+(define_insn "*ret_call_local32"
+  [(set (match_operand 0 "" "=fg,fg")
+	(call (mem:SI (match_operand:SI 1 "current_file_function_operand" "s,s"))
+	      (match_operand 2 "" "g,g")))
+   (use (match_operand:SI 3 "immediate_operand" "O,n"))
+   (clobber (match_scratch:SI 4 "=l,l"))]
+  "(INTVAL (operands[3]) & CALL_LONG) == 0"
+  "*
+{
+  if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS)
+    output_asm_insn (\"crxor 6,6,6\", operands);
+
+  else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS)
+    output_asm_insn (\"creqv 6,6,6\", operands);
+
+  return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"bl %z1@local\" : \"bl %z1\";
+}"
+  [(set_attr "type" "branch")
+   (set_attr "length" "4,8")])
+
+
+(define_insn "*ret_call_local64"
+  [(set (match_operand 0 "" "=fg,fg")
+	(call (mem:SI (match_operand:DI 1 "current_file_function_operand" "s,s"))
+	      (match_operand 2 "" "g,g")))
+   (use (match_operand:SI 3 "immediate_operand" "O,n"))
+   (clobber (match_scratch:SI 4 "=l,l"))]
+  "TARGET_64BIT && (INTVAL (operands[3]) & CALL_LONG) == 0"
+  "*
+{
+  if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS)
+    output_asm_insn (\"crxor 6,6,6\", operands);
+
+  else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS)
+    output_asm_insn (\"creqv 6,6,6\", operands);
+
+  return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"bl %z1@local\" : \"bl %z1\";
+}"
+  [(set_attr "type" "branch")
+   (set_attr "length" "4,8")])
+
+;; Call to function which may be in another module.  Restore the TOC
+;; pointer (r2) after the call unless this is System V.
+;; Operand2 is non-zero if we are using the V.4 calling sequence and
+;; either the function was not prototyped, or it was prototyped as a
+;; variable argument function.  It is > 0 if FP registers were passed
+;; and < 0 if they were not.
+
+(define_insn "*call_nonlocal_aix32"
+  [(call (mem:SI (match_operand:SI 0 "call_operand" "s,s"))
+	 (match_operand 1 "" "fg,fg"))
+   (use (match_operand:SI 2 "immediate_operand" "O,n"))
+   (clobber (match_scratch:SI 3 "=l,l"))]
+  "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT)
+   && (INTVAL (operands[2]) & CALL_LONG) == 0"
+  "*
+{
+  /* Indirect calls should go through call_indirect */
+  if (GET_CODE (operands[0]) == REG)
+    abort ();
+
+  if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS)
+    output_asm_insn (\"crxor 6,6,6\", operands);
+
+  else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
+    output_asm_insn (\"creqv 6,6,6\", operands);
+
+  return (TARGET_WINDOWS_NT) ? \"bl %z0\;.znop %z0\" : \"bl %z0\;%.\";
+}"
+  [(set_attr "type" "branch")
+   (set_attr "length" "8,12")])
+
+(define_insn "*call_nonlocal_aix64"
+  [(call (mem:SI (match_operand:DI 0 "call_operand" "s,s"))
+	 (match_operand 1 "" "fg,fg"))
+   (use (match_operand:SI 2 "immediate_operand" "O,n"))
+   (clobber (match_scratch:SI 3 "=l,l"))]
+  "TARGET_64BIT && (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT)
+   && (INTVAL (operands[2]) & CALL_LONG) == 0"
+  "*
+{
+  /* Indirect calls should go through call_indirect */
+  if (GET_CODE (operands[0]) == REG)
+    abort ();
+
+  if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS)
+    output_asm_insn (\"crxor 6,6,6\", operands);
+
+  else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
+    output_asm_insn (\"creqv 6,6,6\", operands);
+
+  return (TARGET_WINDOWS_NT) ? \"bl %z0\;.znop %z0\" : \"bl %z0\;%.\";
+}"
+  [(set_attr "type" "branch")
+   (set_attr "length" "8,12")])
+
+(define_insn "*call_nonlocal_sysv"
+  [(call (mem:SI (match_operand:SI 0 "call_operand" "s,s"))
+	 (match_operand 1 "" "fg,fg"))
+   (use (match_operand:SI 2 "immediate_operand" "O,n"))
+   (clobber (match_scratch:SI 3 "=l,l"))]
+  "(DEFAULT_ABI == ABI_AIX_NODESC || DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS)
+   && (INTVAL (operands[2]) & CALL_LONG) == 0"
+  "*
+{
+  /* Indirect calls should go through call_indirect */
+  if (GET_CODE (operands[0]) == REG)
+    abort ();
+
+  if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS)
+    output_asm_insn (\"crxor 6,6,6\", operands);
+
+  else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
+    output_asm_insn (\"creqv 6,6,6\", operands);
+
+  return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"bl %z0@plt\" : \"bl %z0\";
+}"
+  [(set_attr "type" "branch")
+   (set_attr "length" "4,8")])
+
+(define_insn "*ret_call_nonlocal_aix32"
+  [(set (match_operand 0 "" "=fg,fg")
+	(call (mem:SI (match_operand:SI 1 "call_operand" "s,s"))
+	      (match_operand 2 "" "fg,fg")))
+   (use (match_operand:SI 3 "immediate_operand" "O,n"))
+   (clobber (match_scratch:SI 4 "=l,l"))]
+  "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT)
+   && (INTVAL (operands[3]) & CALL_LONG) == 0"
+  "*
+{
+  /* This should be handled by call_value_indirect */
+  if (GET_CODE (operands[1]) == REG)
+    abort ();
+
+  if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS)
+    output_asm_insn (\"crxor 6,6,6\", operands);
+
+  else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS)
+    output_asm_insn (\"creqv 6,6,6\", operands);
+
+  return (TARGET_WINDOWS_NT) ? \"bl %z1\;.znop %z1\" : \"bl %z1\;%.\";
+}"
+  [(set_attr "type" "branch")
+   (set_attr "length" "8,12")])
+
+(define_insn "*ret_call_nonlocal_aix64"
+  [(set (match_operand 0 "" "=fg,fg")
+	(call (mem:SI (match_operand:DI 1 "call_operand" "s,s"))
+	      (match_operand 2 "" "fg,fg")))
+   (use (match_operand:SI 3 "immediate_operand" "O,n"))
+   (clobber (match_scratch:SI 4 "=l,l"))]
+  "TARGET_64BIT && (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT)
+   && (INTVAL (operands[3]) & CALL_LONG) == 0"
+  "*
+{
+  /* This should be handled by call_value_indirect */
+  if (GET_CODE (operands[1]) == REG)
+    abort ();
+
+  if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS)
+    output_asm_insn (\"crxor 6,6,6\", operands);
+
+  else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS)
+    output_asm_insn (\"creqv 6,6,6\", operands);
+
+  return (TARGET_WINDOWS_NT) ? \"bl %z1\;.znop %z1\" : \"bl %z1\;%.\";
+}"
+  [(set_attr "type" "branch")
+   (set_attr "length" "8,12")])
+
+(define_insn "*ret_call_nonlocal_sysv"
+  [(set (match_operand 0 "" "=fg,fg")
+	(call (mem:SI (match_operand:SI 1 "call_operand" "s,s"))
+	      (match_operand 2 "" "fg,fg")))
+   (use (match_operand:SI 3 "immediate_operand" "O,n"))
+   (clobber (match_scratch:SI 4 "=l,l"))]
+  "(DEFAULT_ABI == ABI_AIX_NODESC || DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS)
+   && (INTVAL (operands[3]) & CALL_LONG) == 0"
+  "*
+{
+  /* This should be handled by call_value_indirect */
+  if (GET_CODE (operands[1]) == REG)
+    abort ();
+
+  if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS)
+    output_asm_insn (\"crxor 6,6,6\", operands);
+
+  else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS)
+    output_asm_insn (\"creqv 6,6,6\", operands);
+
+  return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"bl %z1@plt\" : \"bl %z1\";
+}"
+  [(set_attr "type" "branch")
+   (set_attr "length" "4,8")])
+
+;; Call subroutine returning any type.
+(define_expand "untyped_call"
+  [(parallel [(call (match_operand 0 "" "")
+		    (const_int 0))
+	      (match_operand 1 "" "")
+	      (match_operand 2 "" "")])]
+  ""
+  "
+{
+  int i;
+
+  emit_call_insn (gen_call (operands[0], const0_rtx, const0_rtx, const0_rtx));
+
+  for (i = 0; i < XVECLEN (operands[2], 0); i++)
+    {
+      rtx set = XVECEXP (operands[2], 0, i);
+      emit_move_insn (SET_DEST (set), SET_SRC (set));
+    }
+
+  /* The optimizer does not know that the call sets the function value
+     registers we stored in the result block.  We avoid problems by
+     claiming that all hard registers are used and clobbered at this
+     point.  */
+  emit_insn (gen_blockage ());
+
+  DONE;
+}")
+
+;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and
+;; all of memory.  This blocks insns from being moved across this point.
+
+(define_insn "blockage"
+  [(unspec_volatile [(const_int 0)] 0)]
+  ""
+  "")
+
+;; V.4 specific code to initialize the PIC register
+
+(define_insn "init_v4_pic"
+  [(set (match_operand:SI 0 "register_operand" "=l")
+	(unspec [(const_int 0)] 7))]
+  "DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS"
+  "bl _GLOBAL_OFFSET_TABLE_@local-4"
+  [(set_attr "type" "branch")
+   (set_attr "length" "4")])
+
+
+;; Compare insns are next.  Note that the RS/6000 has two types of compares,
+;; signed & unsigned, and one type of branch.
+;;
+;; Start with the DEFINE_EXPANDs to generate the rtl for compares, scc
+;; insns, and branches.  We store the operands of compares until we see
+;; how it is used.
+(define_expand "cmpsi"
+  [(set (cc0)
+        (compare (match_operand:SI 0 "gpc_reg_operand" "")
+  		 (match_operand:SI 1 "reg_or_short_operand" "")))]
+  ""
+  "
+{
+  /* Take care of the possibility that operands[1] might be negative but
+     this might be a logical operation.  That insn doesn't exist.  */
+  if (GET_CODE (operands[1]) == CONST_INT
+      && INTVAL (operands[1]) < 0)
+    operands[1] = force_reg (SImode, operands[1]);
+
+  rs6000_compare_op0 = operands[0];
+  rs6000_compare_op1 = operands[1];
+  rs6000_compare_fp_p = 0;
+  DONE;
+}")
+
+(define_expand "cmpdi"
+  [(set (cc0)
+        (compare (match_operand:DI 0 "gpc_reg_operand" "")
+  		 (match_operand:DI 1 "reg_or_short_operand" "")))]
+  "TARGET_POWERPC64"
+  "
+{
+  /* Take care of the possibility that operands[1] might be negative but
+     this might be a logical operation.  That insn doesn't exist.  */
+  if (GET_CODE (operands[1]) == CONST_INT
+      && INTVAL (operands[1]) < 0)
+    operands[1] = force_reg (DImode, operands[1]);
+
+  rs6000_compare_op0 = operands[0];
+  rs6000_compare_op1 = operands[1];
+  rs6000_compare_fp_p = 0;
+  DONE;
+}")
+
+(define_expand "cmpsf"
+  [(set (cc0) (compare (match_operand:SF 0 "gpc_reg_operand" "")
+		       (match_operand:SF 1 "gpc_reg_operand" "")))]
+  "TARGET_HARD_FLOAT"
+  "
+{
+  rs6000_compare_op0 = operands[0];
+  rs6000_compare_op1 = operands[1];
+  rs6000_compare_fp_p = 1;
+  DONE;
+}")
+
+(define_expand "cmpdf"
+  [(set (cc0) (compare (match_operand:DF 0 "gpc_reg_operand" "")
+		       (match_operand:DF 1 "gpc_reg_operand" "")))]
+  "TARGET_HARD_FLOAT"
+  "
+{
+  rs6000_compare_op0 = operands[0];
+  rs6000_compare_op1 = operands[1];
+  rs6000_compare_fp_p = 1;
+  DONE;
+}")
+
+(define_expand "beq"
+  [(set (match_dup 2) (match_dup 1))
+   (set (pc)
+	(if_then_else (eq (match_dup 2)
+			  (const_int 0))
+		      (label_ref (match_operand 0 "" ""))
+		      (pc)))]
+  ""
+  "
+{ enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
+  operands[1] = gen_rtx_COMPARE (mode,
+			 rs6000_compare_op0, rs6000_compare_op1);
+  operands[2] = gen_reg_rtx (mode);
+}")
+
+(define_expand "bne"
+  [(set (match_dup 2) (match_dup 1))
+   (set (pc)
+	(if_then_else (ne (match_dup 2)
+			  (const_int 0))
+		      (label_ref (match_operand 0 "" ""))
+		      (pc)))]
+  ""
+  "
+{ enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
+  operands[1] = gen_rtx_COMPARE (mode,
+			 rs6000_compare_op0, rs6000_compare_op1);
+  operands[2] = gen_reg_rtx (mode);
+}")
+
+(define_expand "blt"
+  [(set (match_dup 2) (match_dup 1))
+   (set (pc)
+	(if_then_else (lt (match_dup 2)
+			  (const_int 0))
+		      (label_ref (match_operand 0 "" ""))
+		      (pc)))]
+  ""
+  "
+{ enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
+  operands[1] = gen_rtx_COMPARE (mode,
+			 rs6000_compare_op0, rs6000_compare_op1);
+  operands[2] = gen_reg_rtx (mode);
+}")
+
+(define_expand "bgt"
+  [(set (match_dup 2) (match_dup 1))
+   (set (pc)
+	(if_then_else (gt (match_dup 2)
+			  (const_int 0))
+		      (label_ref (match_operand 0 "" ""))
+		      (pc)))]
+  ""
+  "
+{ enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
+  operands[1] = gen_rtx_COMPARE (mode,
+			 rs6000_compare_op0, rs6000_compare_op1);
+  operands[2] = gen_reg_rtx (mode);
+}")
+
+(define_expand "ble"
+  [(set (match_dup 2) (match_dup 1))
+   (set (pc)
+	(if_then_else (le (match_dup 2)
+			  (const_int 0))
+		      (label_ref (match_operand 0 "" ""))
+		      (pc)))]
+  ""
+  "
+{ enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
+  operands[1] = gen_rtx_COMPARE (mode,
+			 rs6000_compare_op0, rs6000_compare_op1);
+  operands[2] = gen_reg_rtx (mode);
+}")
+
+(define_expand "bge"
+  [(set (match_dup 2) (match_dup 1))
+   (set (pc)
+	(if_then_else (ge (match_dup 2)
+			  (const_int 0))
+		      (label_ref (match_operand 0 "" ""))
+		      (pc)))]
+  ""
+  "
+{ enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
+  operands[1] = gen_rtx_COMPARE (mode,
+			 rs6000_compare_op0, rs6000_compare_op1);
+  operands[2] = gen_reg_rtx (mode);
+}")
+
+(define_expand "bgtu"
+  [(set (match_dup 2) (match_dup 1))
+   (set (pc)
+	(if_then_else (gtu (match_dup 2)
+			   (const_int 0))
+		      (label_ref (match_operand 0 "" ""))
+		      (pc)))]
+  ""
+  "
+{ operands[1] = gen_rtx_COMPARE (CCUNSmode,
+			 rs6000_compare_op0, rs6000_compare_op1);
+  operands[2] = gen_reg_rtx (CCUNSmode);
+}")
+
+(define_expand "bltu"
+  [(set (match_dup 2) (match_dup 1))
+   (set (pc)
+	(if_then_else (ltu (match_dup 2)
+			   (const_int 0))
+		      (label_ref (match_operand 0 "" ""))
+		      (pc)))]
+  ""
+  "
+{ operands[1] = gen_rtx_COMPARE (CCUNSmode,
+			 rs6000_compare_op0, rs6000_compare_op1);
+  operands[2] = gen_reg_rtx (CCUNSmode);
+}")
+
+(define_expand "bgeu"
+  [(set (match_dup 2) (match_dup 1))
+   (set (pc)
+	(if_then_else (geu (match_dup 2)
+			   (const_int 0))
+		      (label_ref (match_operand 0 "" ""))
+		      (pc)))]
+  ""
+  "
+{ operands[1] = gen_rtx_COMPARE (CCUNSmode,
+			 rs6000_compare_op0, rs6000_compare_op1);
+  operands[2] = gen_reg_rtx (CCUNSmode);
+}")
+
+(define_expand "bleu"
+  [(set (match_dup 2) (match_dup 1))
+   (set (pc)
+	(if_then_else (leu (match_dup 2)
+			   (const_int 0))
+		      (label_ref (match_operand 0 "" ""))
+		      (pc)))]
+  ""
+  "
+{ operands[1] = gen_rtx_COMPARE (CCUNSmode,
+			 rs6000_compare_op0, rs6000_compare_op1);
+  operands[2] = gen_reg_rtx (CCUNSmode);
+}")
+
+;; For SNE, we would prefer that the xor/abs sequence be used for integers.
+;; For SEQ, likewise, except that comparisons with zero should be done
+;; with an scc insns.  However, due to the order that combine see the
+;; resulting insns, we must, in fact, allow SEQ for integers.  Fail in
+;; the cases we don't want to handle.
+(define_expand "seq"
+  [(set (match_dup 2) (match_dup 1))
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(eq:SI (match_dup 2) (const_int 0)))]
+  ""
+  "
+{ enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
+  operands[1] = gen_rtx_COMPARE (mode,
+			 rs6000_compare_op0, rs6000_compare_op1);
+  operands[2] = gen_reg_rtx (mode);
+}")
+
+(define_expand "sne"
+  [(set (match_dup 2) (match_dup 1))
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(ne:SI (match_dup 2) (const_int 0)))]
+  ""
+  "
+{ if (! rs6000_compare_fp_p)
+    FAIL;
+
+  operands[1] = gen_rtx_COMPARE (CCFPmode,
+			 rs6000_compare_op0, rs6000_compare_op1);
+  operands[2] = gen_reg_rtx (CCFPmode);
+}")
+
+;; A > 0 is best done using the portable sequence, so fail in that case.
+(define_expand "sgt"
+  [(set (match_dup 2) (match_dup 1))
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(gt:SI (match_dup 2) (const_int 0)))]
+  ""
+  "
+{ enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
+
+  if (! rs6000_compare_fp_p && rs6000_compare_op1 == const0_rtx)
+    FAIL;
+
+  operands[1] = gen_rtx_COMPARE (mode,
+			 rs6000_compare_op0, rs6000_compare_op1);
+  operands[2] = gen_reg_rtx (mode);
+}")
+
+;; A < 0 is best done in the portable way for A an integer.
+(define_expand "slt"
+  [(set (match_dup 2) (match_dup 1))
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(lt:SI (match_dup 2) (const_int 0)))]
+  ""
+  "
+{ enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
+
+  if (! rs6000_compare_fp_p && rs6000_compare_op1 == const0_rtx)
+    FAIL;
+
+  operands[1] = gen_rtx_COMPARE (mode,
+			 rs6000_compare_op0, rs6000_compare_op1);
+  operands[2] = gen_reg_rtx (mode);
+}")
+
+(define_expand "sge"
+  [(set (match_dup 2) (match_dup 1))
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(ge:SI (match_dup 2) (const_int 0)))]
+  ""
+  "
+{ enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
+  operands[1] = gen_rtx_COMPARE (mode,
+			 rs6000_compare_op0, rs6000_compare_op1);
+  operands[2] = gen_reg_rtx (mode);
+}")
+
+;; A <= 0 is best done the portable way for A an integer.
+(define_expand "sle"
+  [(set (match_dup 2) (match_dup 1))
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(le:SI (match_dup 2) (const_int 0)))]
+  ""
+  "
+{ enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
+
+  if (! rs6000_compare_fp_p && rs6000_compare_op1 == const0_rtx)
+    FAIL;
+
+  operands[1] = gen_rtx_COMPARE (mode,
+			 rs6000_compare_op0, rs6000_compare_op1);
+  operands[2] = gen_reg_rtx (mode);
+}")
+
+(define_expand "sgtu"
+  [(set (match_dup 2) (match_dup 1))
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(gtu:SI (match_dup 2) (const_int 0)))]
+  ""
+  "
+{ operands[1] = gen_rtx_COMPARE (CCUNSmode,
+			 rs6000_compare_op0, rs6000_compare_op1);
+  operands[2] = gen_reg_rtx (CCUNSmode);
+}")
+
+(define_expand "sltu"
+  [(set (match_dup 2) (match_dup 1))
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(ltu:SI (match_dup 2) (const_int 0)))]
+  ""
+  "
+{ operands[1] = gen_rtx_COMPARE (CCUNSmode,
+			 rs6000_compare_op0, rs6000_compare_op1);
+  operands[2] = gen_reg_rtx (CCUNSmode);
+}")
+
+(define_expand "sgeu"
+  [(set (match_dup 2) (match_dup 1))
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(geu:SI (match_dup 2) (const_int 0)))]
+  ""
+  "
+{ operands[1] = gen_rtx_COMPARE (CCUNSmode,
+			 rs6000_compare_op0, rs6000_compare_op1);
+  operands[2] = gen_reg_rtx (CCUNSmode);
+}")
+
+(define_expand "sleu"
+  [(set (match_dup 2) (match_dup 1))
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(leu:SI (match_dup 2) (const_int 0)))]
+  ""
+  "
+{ operands[1] = gen_rtx_COMPARE (CCUNSmode,
+			 rs6000_compare_op0, rs6000_compare_op1);
+  operands[2] = gen_reg_rtx (CCUNSmode);
+}")
+
+;; Here are the actual compare insns.
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+	(compare:CC (match_operand:SI 1 "gpc_reg_operand" "r")
+		    (match_operand:SI 2 "reg_or_short_operand" "rI")))]
+  ""
+  "{cmp%I2|cmpw%I2} %0,%1,%2"
+  [(set_attr "type" "compare")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+	(compare:CC (match_operand:DI 1 "gpc_reg_operand" "r")
+		    (match_operand:DI 2 "reg_or_short_operand" "rI")))]
+  "TARGET_POWERPC64"
+  "cmpd%I2 %0,%1,%2"
+  [(set_attr "type" "compare")])
+
+;; If we are comparing a register for equality with a large constant,
+;; we can do this with an XOR followed by a compare.  But we need a scratch
+;; register for the result of the XOR.
+
+(define_split
+  [(set (match_operand:CC 0 "cc_reg_operand" "")
+	(compare:CC (match_operand:SI 1 "gpc_reg_operand" "")
+		    (match_operand:SI 2 "non_short_cint_operand" "")))
+   (clobber (match_operand:SI 3 "gpc_reg_operand" ""))]
+  "find_single_use (operands[0], insn, 0)
+   && (GET_CODE (*find_single_use (operands[0], insn, 0)) == EQ
+       || GET_CODE (*find_single_use (operands[0], insn, 0)) == NE)"
+  [(set (match_dup 3) (xor:SI (match_dup 1) (match_dup 4)))
+   (set (match_dup 0) (compare:CC (match_dup 3) (match_dup 5)))]
+  "
+{
+  /* Get the constant we are comparing against, C,  and see what it looks like
+     sign-extended to 16 bits.  Then see what constant could be XOR'ed
+     with C to get the sign-extended value.  */
+
+  int c = INTVAL (operands[2]);
+  int sextc = (c << 16) >> 16;
+  int xorv = c ^ sextc;
+
+  operands[4] = GEN_INT (xorv);
+  operands[5] = GEN_INT (sextc);
+}")
+
+(define_insn ""
+  [(set (match_operand:CCUNS 0 "cc_reg_operand" "=y")
+	(compare:CCUNS (match_operand:SI 1 "gpc_reg_operand" "r")
+		       (match_operand:SI 2 "reg_or_u_short_operand" "rK")))]
+  ""
+  "{cmpl%I2|cmplw%I2} %0,%1,%W2"
+  [(set_attr "type" "compare")])
+
+(define_insn ""
+  [(set (match_operand:CCUNS 0 "cc_reg_operand" "=y")
+	(compare:CCUNS (match_operand:DI 1 "gpc_reg_operand" "r")
+		       (match_operand:DI 2 "reg_or_u_short_operand" "rK")))]
+  ""
+  "cmpld%I2 %0,%1,%W2"
+  [(set_attr "type" "compare")])
+
+;; The following two insns don't exist as single insns, but if we provide
+;; them, we can swap an add and compare, which will enable us to overlap more
+;; of the required delay between a compare and branch.  We generate code for
+;; them by splitting.
+
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=y")
+	(compare:CC (match_operand:SI 1 "gpc_reg_operand" "r")
+		    (match_operand:SI 2 "short_cint_operand" "i")))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(plus:SI (match_dup 1) (match_operand:SI 4 "short_cint_operand" "i")))]
+  ""
+  "#"
+  [(set_attr "length" "8")])
+
+(define_insn ""
+  [(set (match_operand:CCUNS 3 "cc_reg_operand" "=y")
+	(compare:CCUNS (match_operand:SI 1 "gpc_reg_operand" "r")
+		       (match_operand:SI 2 "u_short_cint_operand" "i")))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(plus:SI (match_dup 1) (match_operand:SI 4 "short_cint_operand" "i")))]
+  ""
+  "#"
+  [(set_attr "length" "8")])
+
+(define_split
+  [(set (match_operand:CC 3 "cc_reg_operand" "")
+	(compare:CC (match_operand:SI 1 "gpc_reg_operand" "")
+		    (match_operand:SI 2 "short_cint_operand" "")))
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(plus:SI (match_dup 1) (match_operand:SI 4 "short_cint_operand" "")))]
+  ""
+  [(set (match_dup 3) (compare:CC (match_dup 1) (match_dup 2)))
+   (set (match_dup 0) (plus:SI (match_dup 1) (match_dup 4)))])
+
+(define_split
+  [(set (match_operand:CCUNS 3 "cc_reg_operand" "")
+	(compare:CCUNS (match_operand:SI 1 "gpc_reg_operand" "")
+		       (match_operand:SI 2 "u_short_cint_operand" "")))
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(plus:SI (match_dup 1) (match_operand:SI 4 "short_cint_operand" "")))]
+  ""
+  [(set (match_dup 3) (compare:CCUNS (match_dup 1) (match_dup 2)))
+   (set (match_dup 0) (plus:SI (match_dup 1) (match_dup 4)))])
+
+(define_insn ""
+  [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
+	(compare:CCFP (match_operand:SF 1 "gpc_reg_operand" "f")
+		      (match_operand:SF 2 "gpc_reg_operand" "f")))]
+  "TARGET_HARD_FLOAT"
+  "fcmpu %0,%1,%2"
+  [(set_attr "type" "fpcompare")])
+
+(define_insn ""
+  [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
+	(compare:CCFP (match_operand:DF 1 "gpc_reg_operand" "f")
+		      (match_operand:DF 2 "gpc_reg_operand" "f")))]
+  "TARGET_HARD_FLOAT"
+  "fcmpu %0,%1,%2"
+  [(set_attr "type" "fpcompare")])
+
+;; Now we have the scc insns.  We can do some combinations because of the
+;; way the machine works.
+;;
+;; Note that this is probably faster if we can put an insn between the
+;; mfcr and rlinm, but this is tricky.  Let's leave it for now.  In most
+;; cases the insns below which don't use an intermediate CR field will
+;; be used instead.
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(match_operator:SI 1 "scc_comparison_operator"
+			   [(match_operand 2 "cc_reg_operand" "y")
+			    (const_int 0)]))]
+  ""
+  "%D1mfcr %0\;{rlinm|rlwinm} %0,%0,%J1,1"
+  [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC (match_operator:SI 1 "scc_comparison_operator"
+				       [(match_operand 2 "cc_reg_operand" "y")
+					(const_int 0)])
+		    (const_int 0)))
+   (set (match_operand:SI 3 "gpc_reg_operand" "=r")
+	(match_op_dup 1 [(match_dup 2) (const_int 0)]))]
+  "! TARGET_POWERPC64"
+  "%D1mfcr %3\;{rlinm.|rlwinm.} %3,%3,%J1,1"
+  [(set_attr "type" "delayed_compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(ashift:SI (match_operator:SI 1 "scc_comparison_operator"
+				      [(match_operand 2 "cc_reg_operand" "y")
+				       (const_int 0)])
+		   (match_operand:SI 3 "const_int_operand" "n")))]
+  ""
+  "*
+{
+  int is_bit = ccr_bit (operands[1], 1);
+  int put_bit = 31 - (INTVAL (operands[3]) & 31);
+  int count;
+
+  if (is_bit >= put_bit)
+    count = is_bit - put_bit;
+  else
+    count = 32 - (put_bit - is_bit);
+
+  operands[4] = GEN_INT (count);
+  operands[5] = GEN_INT (put_bit);
+
+  return \"%D1mfcr %0\;{rlinm|rlwinm} %0,%0,%4,%5,%5\";
+}"
+ [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC
+	 (ashift:SI (match_operator:SI 1 "scc_comparison_operator"
+				       [(match_operand 2 "cc_reg_operand" "y")
+					(const_int 0)])
+		    (match_operand:SI 3 "const_int_operand" "n"))
+	 (const_int 0)))
+   (set (match_operand:SI 4 "gpc_reg_operand" "=r")
+	(ashift:SI (match_op_dup 1 [(match_dup 2) (const_int 0)])
+		   (match_dup 3)))]
+  ""
+  "*
+{
+  int is_bit = ccr_bit (operands[1], 1);
+  int put_bit = 31 - (INTVAL (operands[3]) & 31);
+  int count;
+
+  if (is_bit >= put_bit)
+    count = is_bit - put_bit;
+  else
+    count = 32 - (put_bit - is_bit);
+
+  operands[5] = GEN_INT (count);
+  operands[6] = GEN_INT (put_bit);
+
+  return \"%D1mfcr %4\;{rlinm.|rlwinm.} %4,%4,%5,%6,%6\";
+}"
+  [(set_attr "type" "delayed_compare")
+   (set_attr "length" "12")])
+
+;; If we are comparing the result of two comparisons, this can be done
+;; using creqv or crxor.
+
+(define_insn ""
+  [(set (match_operand:CCEQ 0 "cc_reg_operand" "=y")
+	(compare:CCEQ (match_operator 1 "scc_comparison_operator"
+			      [(match_operand 2 "cc_reg_operand" "y")
+			       (const_int 0)])
+		      (match_operator 3 "scc_comparison_operator"
+			      [(match_operand 4 "cc_reg_operand" "y")
+			       (const_int 0)])))]
+  "REGNO (operands[2]) != REGNO (operands[4])"
+  "*
+{
+  enum rtx_code code1, code2;
+
+  code1 = GET_CODE (operands[1]);
+  code2 = GET_CODE (operands[3]);
+
+  if ((code1 == EQ || code1 == LT || code1 == GT
+       || code1 == LTU || code1 == GTU
+       || (code1 != NE && GET_MODE (operands[2]) == CCFPmode))
+      !=
+      (code2 == EQ || code2 == LT || code2 == GT
+       || code2 == LTU || code2 == GTU
+       || (code2 != NE && GET_MODE (operands[4]) == CCFPmode)))
+    return \"%C1%C3crxor %E0,%j1,%j3\";
+  else
+    return \"%C1%C3creqv %E0,%j1,%j3\";
+}"
+  [(set_attr "length" "12")])
+
+;; There is a 3 cycle delay between consecutive mfcr instructions
+;; so it is useful to combine 2 scc instructions to use only one mfcr.
+
+(define_peephole
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(match_operator:SI 1 "scc_comparison_operator"
+			   [(match_operand 2 "cc_reg_operand" "y")
+			    (const_int 0)]))
+   (set (match_operand:SI 3 "gpc_reg_operand" "=r")
+	(match_operator:SI 4 "scc_comparison_operator"
+			   [(match_operand 5 "cc_reg_operand" "y")
+			    (const_int 0)]))]
+   "REGNO (operands[2]) != REGNO (operands[5])"
+   "%D1%D4mfcr %3\;{rlinm|rlwinm} %0,%3,%J1,1\;{rlinm|rlwinm} %3,%3,%J4,1"
+   [(set_attr "length" "20")])
+
+;; There are some scc insns that can be done directly, without a compare.
+;; These are faster because they don't involve the communications between
+;; the FXU and branch units.   In fact, we will be replacing all of the
+;; integer scc insns here or in the portable methods in emit_store_flag.
+;;
+;; Also support (neg (scc ..)) since that construct is used to replace
+;; branches, (plus (scc ..) ..) since that construct is common and
+;; takes no more insns than scc, and (and (neg (scc ..)) ..) in the
+;; cases where it is no more expensive than (neg (scc ..)).
+
+;; Have reload force a constant into a register for the simple insns that
+;; otherwise won't accept constants.  We do this because it is faster than
+;; the cmp/mfcr sequence we would otherwise generate.
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r")
+	(eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r")
+	       (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,J,I")))
+   (clobber (match_scratch:SI 3 "=r,&r,r,r,r"))]
+  "! TARGET_POWERPC64"
+  "@
+   xor %0,%1,%2\;{sfi|subfic} %3,%0,0\;{ae|adde} %0,%3,%0
+   {sfi|subfic} %3,%1,0\;{ae|adde} %0,%3,%1
+   {xoril|xori} %0,%1,%b2\;{sfi|subfic} %3,%0,0\;{ae|adde} %0,%3,%0
+   {xoriu|xoris} %0,%1,%u2\;{sfi|subfic} %3,%0,0\;{ae|adde} %0,%3,%0
+   {sfi|subfic} %0,%1,%2\;{sfi|subfic} %3,%0,0\;{ae|adde} %0,%3,%0"
+  [(set_attr "length" "12,8,12,12,12")])
+
+(define_insn ""
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r,r")
+	(eq:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r")
+	       (match_operand:DI 2 "reg_or_cint_operand" "r,O,K,J,I")))
+   (clobber (match_scratch:DI 3 "=r,&r,r,r,r"))]
+  "TARGET_POWERPC64"
+  "@
+   xor %0,%1,%2\;subfic %3,%0,0\;adde %0,%3,%0
+   subfic %3,%1,0\;adde %0,%3,%1
+   xori %0,%1,%b2\;subfic %3,%0,0\;adde %0,%3,%0
+   xoris %0,%1,%u2\;subfic %3,%0,0\;adde %0,%3,%0
+   subfic %0,%1,%2\;subfic %3,%0,0\;adde %0,%3,%0"
+  [(set_attr "length" "12,8,12,12,12")])
+
+(define_insn ""
+  [(set (match_operand:CC 4 "cc_reg_operand" "=x,x,x,x,x")
+	(compare:CC
+	 (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r")
+		(match_operand:SI 2 "reg_or_cint_operand" "r,O,K,J,I"))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r")
+	(eq:SI (match_dup 1) (match_dup 2)))
+   (clobber (match_scratch:SI 3 "=r,&r,r,r,r"))]
+  "! TARGET_POWERPC64"
+  "@
+   xor %0,%1,%2\;{sfi|subfic} %3,%0,0\;{ae.|adde.} %0,%3,%0
+   {sfi|subfic} %3,%1,0\;{ae.|adde.} %0,%3,%1
+   {xoril|xori} %0,%1,%b2\;{sfi|subfic} %3,%0,0\;{ae.|adde.} %0,%3,%0
+   {xoriu|xoris} %0,%1,%u2\;{sfi|subfic} %3,%0,0\;{ae.|adde.} %0,%3,%0
+   {sfi|subfic} %0,%1,%2\;{sfi|subfic} %3,%0,0\;{ae.|adde.} %0,%3,%0"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12,8,12,12,12")])
+
+(define_insn ""
+  [(set (match_operand:CC 4 "cc_reg_operand" "=x,x,x,x,x")
+	(compare:CC
+	 (eq:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r")
+		(match_operand:DI 2 "reg_or_cint_operand" "r,O,K,J,I"))
+	 (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r,r")
+	(eq:DI (match_dup 1) (match_dup 2)))
+   (clobber (match_scratch:DI 3 "=r,&r,r,r,r"))]
+  "TARGET_POWERPC64"
+  "@
+   xor %0,%1,%2\;subfic %3,%0,0\;adde. %0,%3,%0
+   subfic %3,%1,0\;adde. %0,%3,%1
+   xori %0,%1,%b2\;subfic %3,%0,0\;adde. %0,%3,%0
+   xoris %0,%1,%u2\;subfic %3,%0,0\;adde. %0,%3,%0
+   subfic %0,%1,%2\;subfic %3,%0,0\;adde. %0,%3,%0"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12,8,12,12,12")])
+
+;; We have insns of the form shown by the first define_insn below.  If
+;; there is something inside the comparison operation, we must split it.
+(define_split
+  [(set (match_operand:SI 0 "gpc_reg_operand" "")
+	(plus:SI (match_operator 1 "comparison_operator"
+				 [(match_operand:SI 2 "" "")
+				  (match_operand:SI 3
+						    "reg_or_cint_operand" "")])
+		 (match_operand:SI 4 "gpc_reg_operand" "")))
+   (clobber (match_operand:SI 5 "register_operand" ""))]
+  "! gpc_reg_operand (operands[2], SImode)"
+  [(set (match_dup 5) (match_dup 2))
+   (set (match_dup 2) (plus:SI (match_op_dup 1 [(match_dup 2) (match_dup 3)])
+			       (match_dup 4)))])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r")
+	(plus:SI (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r")
+			(match_operand:SI 2 "reg_or_cint_operand" "r,O,K,J,I"))
+		 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r,r")))
+   (clobber (match_scratch:SI 4 "=&r,&r,&r,&r,&r"))]
+  "! TARGET_POWERPC64"
+  "@
+   xor %4,%1,%2\;{sfi|subfic} %4,%4,0\;{aze|addze} %0,%3
+   {sfi|subfic} %4,%1,0\;{aze|addze} %0,%3
+   {xoril|xori} %4,%1,%b2\;{sfi|subfic} %4,%4,0\;{aze|addze} %0,%3
+   {xoriu|xoris} %4,%1,%u2\;{sfi|subfic} %4,%4,0\;{aze|addze} %0,%3
+   {sfi|subfic} %4,%1,%2\;{sfi|subfic} %4,%4,0\;{aze|addze} %0,%3"
+  [(set_attr "length" "12,8,12,12,12")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,x,x,x")
+	(compare:CC
+	 (plus:SI
+	  (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r")
+		 (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,J,I"))
+	  (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r,r"))
+	 (const_int 0)))
+   (clobber (match_scratch:SI 4 "=&r,&r,&r,&r,&r"))]
+  "! TARGET_POWERPC64"
+  "@
+   xor %4,%1,%2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %4,%3
+   {sfi|subfic} %4,%1,0\;{aze.|addze.} %4,%3
+   {xoril|xori} %4,%1,%b2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %4,%3
+   {xoriu|xoris} %4,%1,%u2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %4,%3
+   {sfi|subfic} %4,%1,%2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %4,%3"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12,8,12,12,12")])
+
+(define_insn ""
+  [(set (match_operand:CC 5 "cc_reg_operand" "=x,x,x,x,x")
+	(compare:CC
+	 (plus:SI
+	  (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r")
+		 (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,J,I"))
+	  (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r,r"))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r")
+	(plus:SI (eq:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
+   (clobber (match_scratch:SI 4 "=&r,&r,&r,&r,&r"))]
+  "! TARGET_POWERPC64"
+  "@
+   xor %4,%1,%2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %0,%3
+   {sfi|subfic} %4,%1,0\;{aze.|addze.} %0,%3
+   {xoril|xori} %4,%1,%b2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %0,%3
+   {xoriu|xoris} %4,%1,%u2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %0,%3
+   {sfi|subfic} %4,%1,%2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %0,%3"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12,8,12,12,12")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r")
+	(neg:SI (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r")
+		       (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,J,I"))))]
+  "! TARGET_POWERPC64"
+  "@
+   xor %0,%1,%2\;{ai|addic} %0,%0,-1\;{sfe|subfe} %0,%0,%0
+   {ai|addic} %0,%1,-1\;{sfe|subfe} %0,%0,%0
+   {xoril|xori} %0,%1,%b2\;{ai|addic} %0,%0,-1\;{sfe|subfe} %0,%0,%0
+   {xoriu|xoris} %0,%1,%u2\;{ai|addic} %0,%0,-1\;{sfe|subfe} %0,%0,%0
+   {sfi|subfic} %0,%1,%2\;{ai|addic} %0,%0,-1\;{sfe|subfe} %0,%0,%0"
+   [(set_attr "length" "12,8,12,12,12")])
+
+;; Simplify (ne X (const_int 0)) on the PowerPC.  No need to on the Power,
+;; since it nabs/sr is just as fast.
+(define_insn "*ne0"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=&r")
+	(lshiftrt:SI (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r")))
+		     (const_int 31)))
+   (clobber (match_scratch:SI 2 "=&r"))]
+  "! TARGET_POWER && ! TARGET_POWERPC64"
+  "{ai|addic} %2,%1,-1\;{sfe|subfe} %0,%2,%1"
+  [(set_attr "length" "8")])
+
+(define_insn ""
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(lshiftrt:DI (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r")))
+		     (const_int 63)))
+   (clobber (match_scratch:DI 2 "=&r"))]
+  "TARGET_POWERPC64"
+  "addic %2,%1,-1\;subfe %0,%2,%1"
+  [(set_attr "length" "8")])
+
+;; This is what (plus (ne X (const_int 0)) Y) looks like.
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(plus:SI (lshiftrt:SI
+		  (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r")))
+		  (const_int 31))
+		 (match_operand:SI 2 "gpc_reg_operand" "r")))
+   (clobber (match_scratch:SI 3 "=&r"))]
+  "! TARGET_POWERPC64"
+  "{ai|addic} %3,%1,-1\;{aze|addze} %0,%2"
+  [(set_attr "length" "8")])
+
+(define_insn ""
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(plus:DI (lshiftrt:DI
+		  (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r")))
+		  (const_int 63))
+		 (match_operand:DI 2 "gpc_reg_operand" "r")))
+   (clobber (match_scratch:DI 3 "=&r"))]
+  "TARGET_POWERPC64"
+  "addic %3,%1,-1\;addze %0,%2"
+  [(set_attr "length" "8")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC
+	 (plus:SI (lshiftrt:SI
+		   (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r")))
+		   (const_int 31))
+		  (match_operand:SI 2 "gpc_reg_operand" "r"))
+	 (const_int 0)))
+   (clobber (match_scratch:SI 3 "=&r"))]
+  "! TARGET_POWERPC64"
+  "{ai|addic} %3,%1,-1\;{aze.|addze.} %3,%2"
+  [(set_attr "type" "compare")
+   (set_attr "length" "8")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC
+	 (plus:DI (lshiftrt:DI
+		   (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r")))
+		   (const_int 63))
+		  (match_operand:DI 2 "gpc_reg_operand" "r"))
+	 (const_int 0)))
+   (clobber (match_scratch:DI 3 "=&r"))]
+  "TARGET_POWERPC64"
+  "addic %3,%1,-1\;addze. %3,%2"
+  [(set_attr "type" "compare")
+   (set_attr "length" "8")])
+
+(define_insn ""
+  [(set (match_operand:CC 4 "cc_reg_operand" "=x")
+	(compare:CC
+	 (plus:SI (lshiftrt:SI
+		   (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r")))
+		   (const_int 31))
+		  (match_operand:SI 2 "gpc_reg_operand" "r"))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(plus:SI (lshiftrt:SI (neg:SI (abs:SI (match_dup 1))) (const_int 31))
+		 (match_dup 2)))
+   (clobber (match_scratch:SI 3 "=&r"))]
+  "! TARGET_POWERPC64"
+  "{ai|addic} %3,%1,-1\;{aze.|addze.} %0,%2"
+  [(set_attr "type" "compare")
+   (set_attr "length" "8")])
+
+(define_insn ""
+  [(set (match_operand:CC 4 "cc_reg_operand" "=x")
+	(compare:CC
+	 (plus:DI (lshiftrt:DI
+		   (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r")))
+		   (const_int 63))
+		  (match_operand:DI 2 "gpc_reg_operand" "r"))
+	 (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(plus:DI (lshiftrt:DI (neg:DI (abs:DI (match_dup 1))) (const_int 63))
+		 (match_dup 2)))
+   (clobber (match_scratch:DI 3 "=&r"))]
+  "TARGET_POWERPC64"
+  "addic %3,%1,-1\;addze. %0,%2"
+  [(set_attr "type" "compare")
+   (set_attr "length" "8")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(le:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+	       (match_operand:SI 2 "reg_or_short_operand" "r,O")))
+   (clobber (match_scratch:SI 3 "=r,X"))]
+  "TARGET_POWER"
+  "@
+   doz %3,%2,%1\;{sfi|subfic} %0,%3,0\;{ae|adde} %0,%0,%3
+   {ai|addic} %0,%1,-1\;{aze|addze} %0,%0\;{sri|srwi} %0,%0,31"
+  [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 4 "cc_reg_operand" "=x,x")
+	(compare:CC
+	 (le:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+		(match_operand:SI 2 "reg_or_short_operand" "r,O"))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(le:SI (match_dup 1) (match_dup 2)))
+   (clobber (match_scratch:SI 3 "=r,X"))]
+  "TARGET_POWER"
+  "@
+   doz %3,%2,%1\;{sfi|subfic} %0,%3,0\;{ae.|adde.} %0,%0,%3
+   {ai|addic} %0,%1,-1\;{aze|addze} %0,%0\;{sri.|srwi.} %0,%0,31"
+  [(set_attr "type" "compare,delayed_compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(plus:SI (le:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+			(match_operand:SI 2 "reg_or_short_operand" "r,O"))
+		 (match_operand:SI 3 "gpc_reg_operand" "r,r")))
+   (clobber (match_scratch:SI 4 "=&r,&r"))]
+  "TARGET_POWER"
+  "@
+   doz %4,%2,%1\;{sfi|subfic} %4,%4,0\;{aze|addze} %0,%3
+   {srai|srawi} %4,%1,31\;{sf|subfc} %4,%1,%4\;{aze|addze} %0,%3"
+  [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x,x")
+	(compare:CC
+	 (plus:SI (le:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+			 (match_operand:SI 2 "reg_or_short_operand" "r,O"))
+		  (match_operand:SI 3 "gpc_reg_operand" "r,r"))
+	 (const_int 0)))
+   (clobber (match_scratch:SI 4 "=&r,&r"))]
+  "TARGET_POWER"
+  "@
+   doz %4,%2,%1\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %4,%3
+   {srai|srawi} %4,%1,31\;{sf|subfc} %4,%1,%4\;{aze.|addze.} %4,%3"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 5 "cc_reg_operand" "=x,x")
+	(compare:CC
+	 (plus:SI (le:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+			 (match_operand:SI 2 "reg_or_short_operand" "r,O"))
+		  (match_operand:SI 3 "gpc_reg_operand" "r,r"))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(plus:SI (le:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
+   (clobber (match_scratch:SI 4 "=&r,&r"))]
+  "TARGET_POWER"
+  "@
+   doz %4,%2,%1\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %0,%3
+   {srai|srawi} %4,%1,31\;{sf|subfc} %4,%1,%4\;{aze.|addze.} %0,%3"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(neg:SI (le:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+		       (match_operand:SI 2 "reg_or_short_operand" "r,O"))))]
+  "TARGET_POWER"
+  "@
+   doz %0,%2,%1\;{ai|addic} %0,%0,-1\;{sfe|subfe} %0,%0,%0
+   {ai|addic} %0,%1,-1\;{aze|addze} %0,%0\;{srai|srawi} %0,%0,31"
+  [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(leu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+		(match_operand:SI 2 "reg_or_short_operand" "rI")))]
+  "! TARGET_POWERPC64"
+  "{sf%I2|subf%I2c} %0,%1,%2\;{cal %0,0(0)|li %0,0}\;{ae|adde} %0,%0,%0"
+  [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(leu:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+		(match_operand:DI 2 "reg_or_short_operand" "rI")))]
+  "TARGET_POWERPC64"
+  "subf%I2c %0,%1,%2\;li %0,0\;adde %0,%0,%0"
+  [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC
+	 (leu:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+		 (match_operand:DI 2 "reg_or_short_operand" "rI"))
+	 (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(leu:DI (match_dup 1) (match_dup 2)))]
+  "TARGET_POWERPC64"
+  "subf%I2c %0,%1,%2\;li %0,0\;adde. %0,%0,%0"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC
+	 (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+		 (match_operand:SI 2 "reg_or_short_operand" "rI"))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(leu:SI (match_dup 1) (match_dup 2)))]
+  "! TARGET_POWERPC64"
+  "{sf%I2|subf%I2c} %0,%1,%2\;{cal %0,0(0)|li %0,0}\;{ae.|adde.} %0,%0,%0"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC
+	 (leu:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+		 (match_operand:DI 2 "reg_or_short_operand" "rI"))
+	 (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(leu:DI (match_dup 1) (match_dup 2)))]
+  "TARGET_POWERPC64"
+  "subf%I2c %0,%1,%2\;li %0,0\;adde. %0,%0,%0"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(plus:SI (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			 (match_operand:SI 2 "reg_or_short_operand" "rI"))
+		 (match_operand:SI 3 "gpc_reg_operand" "r")))
+   (clobber (match_scratch:SI 4 "=&r"))]
+  "! TARGET_POWERPC64"
+  "{sf%I2|subf%I2c} %4,%1,%2\;{aze|addze} %0,%3"
+  [(set_attr "length" "8")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC
+	 (plus:SI (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			  (match_operand:SI 2 "reg_or_short_operand" "rI"))
+		  (match_operand:SI 3 "gpc_reg_operand" "r"))
+	 (const_int 0)))
+   (clobber (match_scratch:SI 4 "=&r"))]
+  "! TARGET_POWERPC64"
+  "{sf%I2|subf%I2c} %4,%1,%2\;{aze.|addze.} %4,%3"
+  [(set_attr "type" "compare")
+   (set_attr "length" "8")])
+
+(define_insn ""
+  [(set (match_operand:CC 5 "cc_reg_operand" "=x")
+	(compare:CC
+	 (plus:SI (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			  (match_operand:SI 2 "reg_or_short_operand" "rI"))
+		  (match_operand:SI 3 "gpc_reg_operand" "r"))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(plus:SI (leu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
+   (clobber (match_scratch:SI 4 "=&r"))]
+  "! TARGET_POWERPC64"
+  "{sf%I2|subf%I2c} %4,%1,%2\;{aze.|addze.} %0,%3"
+  [(set_attr "type" "compare")
+   (set_attr "length" "8")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(neg:SI (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			(match_operand:SI 2 "reg_or_short_operand" "rI"))))]
+  "! TARGET_POWERPC64"
+  "{sf%I2|subf%I2c} %0,%1,%2\;{sfe|subfe} %0,%0,%0\;nand %0,%0,%0"
+   [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(and:SI (neg:SI
+		 (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			 (match_operand:SI 2 "reg_or_short_operand" "rI")))
+		(match_operand:SI 3 "gpc_reg_operand" "r")))
+   (clobber (match_scratch:SI 4 "=&r"))]
+  "! TARGET_POWERPC64"
+  "{sf%I2|subf%I2c} %4,%1,%2\;{sfe|subfe} %4,%4,%4\;andc %0,%3,%4"
+  [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC
+	 (and:SI (neg:SI
+		  (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			  (match_operand:SI 2 "reg_or_short_operand" "rI")))
+		 (match_operand:SI 3 "gpc_reg_operand" "r"))
+	 (const_int 0)))
+   (clobber (match_scratch:SI 4 "=&r"))]
+  "! TARGET_POWERPC64"
+  "{sf%I2|subf%I2c} %4,%1,%2\;{sfe|subfe} %4,%4,%4\;andc. %4,%3,%4"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 5 "cc_reg_operand" "=x")
+	(compare:CC
+	 (and:SI (neg:SI
+		  (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			  (match_operand:SI 2 "reg_or_short_operand" "rI")))
+		 (match_operand:SI 3 "gpc_reg_operand" "r"))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(and:SI (neg:SI (leu:SI (match_dup 1) (match_dup 2))) (match_dup 3)))
+   (clobber (match_scratch:SI 4 "=&r"))]
+  "! TARGET_POWERPC64"
+  "{sf%I2|subf%I2c} %4,%1,%2\;{sfe|subfe} %4,%4,%4\;andc. %0,%3,%4"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(lt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+	       (match_operand:SI 2 "reg_or_short_operand" "rI")))]
+  "TARGET_POWER"
+  "doz%I2 %0,%1,%2\;nabs %0,%0\;{sri|srwi} %0,%0,31"
+   [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC
+	 (lt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+		(match_operand:SI 2 "reg_or_short_operand" "rI"))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(lt:SI (match_dup 1) (match_dup 2)))]
+  "TARGET_POWER"
+  "doz%I2 %0,%1,%2\;nabs %0,%0\;{sri.|srwi.} %0,%0,31"
+  [(set_attr "type" "delayed_compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(plus:SI (lt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			(match_operand:SI 2 "reg_or_short_operand" "rI"))
+		 (match_operand:SI 3 "gpc_reg_operand" "r")))
+   (clobber (match_scratch:SI 4 "=&r"))]
+  "TARGET_POWER"
+  "doz%I2 %4,%1,%2\;{ai|addic} %4,%4,-1\;{aze|addze} %0,%3"
+  [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC
+	 (plus:SI (lt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			 (match_operand:SI 2 "reg_or_short_operand" "rI"))
+		  (match_operand:SI 3 "gpc_reg_operand" "r"))
+	 (const_int 0)))
+   (clobber (match_scratch:SI 4 "=&r"))]
+  "TARGET_POWER"
+  "doz%I2 %4,%1,%2\;{ai|addic} %4,%4,-1\;{aze.|addze.} %4,%3"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 5 "cc_reg_operand" "=x")
+	(compare:CC
+	 (plus:SI (lt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			 (match_operand:SI 2 "reg_or_short_operand" "rI"))
+		  (match_operand:SI 3 "gpc_reg_operand" "r"))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(plus:SI (lt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
+   (clobber (match_scratch:SI 4 "=&r"))]
+  "TARGET_POWER"
+  "doz%I2 %4,%1,%2\;{ai|addic} %4,%4,-1\;{aze.|addze.} %0,%3"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(neg:SI (lt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+		       (match_operand:SI 2 "reg_or_short_operand" "rI"))))]
+  "TARGET_POWER"
+  "doz%I2 %0,%1,%2\;nabs %0,%0\;{srai|srawi} %0,%0,31"
+  [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+		(match_operand:SI 2 "reg_or_neg_short_operand" "r,P")))]
+  "! TARGET_POWERPC64"
+  "@
+   {sf|subfc} %0,%2,%1\;{sfe|subfe} %0,%0,%0\;neg %0,%0
+   {ai|addic} %0,%1,%n2\;{sfe|subfe} %0,%0,%0\;neg %0,%0"
+  [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x,x")
+	(compare:CC
+	 (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+		 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P"))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(ltu:SI (match_dup 1) (match_dup 2)))]
+  "! TARGET_POWERPC64"
+  "@
+   {sf|subfc} %0,%2,%1\;{sfe|subfe} %0,%0,%0\;neg. %0,%0
+   {ai|addic} %0,%1,%n2\;{sfe|subfe} %0,%0,%0\;neg. %0,%0"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(plus:SI (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+			 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P"))
+		 (match_operand:SI 3 "reg_or_short_operand" "rI,rI")))
+   (clobber (match_scratch:SI 4 "=&r,&r"))]
+  "! TARGET_POWERPC64"
+  "@
+  {sf|subfc} %4,%2,%1\;{sfe|subfe} %4,%4,%4\;{sf%I3|subf%I3c} %0,%4,%3
+  {ai|addic} %4,%1,%n2\;{sfe|subfe} %4,%4,%4\;{sf%I3|subf%I3c} %0,%4,%3"
+ [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x,x")
+	(compare:CC
+	 (plus:SI (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+			  (match_operand:SI 2 "reg_or_neg_short_operand" "r,P"))
+		  (match_operand:SI 3 "gpc_reg_operand" "r,r"))
+	 (const_int 0)))
+   (clobber (match_scratch:SI 4 "=&r,&r"))]
+  "! TARGET_POWERPC64"
+  "@
+   {sf|subfc} %4,%2,%1\;{sfe|subfe} %4,%4,%4\;{sf.|subfc.} %4,%4,%3
+   {ai|addic} %4,%1,%n2\;{sfe|subfe} %4,%4,%4\;{sf.|subfc.} %4,%4,%3"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 5 "cc_reg_operand" "=x,x")
+	(compare:CC
+	 (plus:SI (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+			  (match_operand:SI 2 "reg_or_neg_short_operand" "r,P"))
+		  (match_operand:SI 3 "gpc_reg_operand" "r,r"))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(plus:SI (ltu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
+   (clobber (match_scratch:SI 4 "=&r,&r"))]
+  "! TARGET_POWERPC64"
+  "@
+   {sf|subfc} %4,%2,%1\;{sfe|subfe} %4,%4,%4\;{sf.|subfc.} %0,%4,%3
+   {ai|addic} %4,%1,%n2\;{sfe|subfe} %4,%4,%4\;{sf.|subfc.} %0,%4,%3"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(neg:SI (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+			(match_operand:SI 2 "reg_or_neg_short_operand" "r,P"))))]
+  "! TARGET_POWERPC64"
+  "@
+   {sf|subfc} %0,%2,%1\;{sfe|subfe} %0,%0,%0
+   {ai|addic} %0,%1,%n2\;{sfe|subfe} %0,%0,%0"
+  [(set_attr "length" "8")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(ge:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+	       (match_operand:SI 2 "reg_or_short_operand" "rI")))
+   (clobber (match_scratch:SI 3 "=r"))]
+  "TARGET_POWER"
+  "doz%I2 %3,%1,%2\;{sfi|subfic} %0,%3,0\;{ae|adde} %0,%0,%3"
+   [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 4 "cc_reg_operand" "=x")
+	(compare:CC
+	 (ge:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+		(match_operand:SI 2 "reg_or_short_operand" "rI"))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(ge:SI (match_dup 1) (match_dup 2)))
+   (clobber (match_scratch:SI 3 "=r"))]
+  "TARGET_POWER"
+  "doz%I2 %3,%1,%2\;{sfi|subfic} %0,%3,0\;{ae.|adde.} %0,%0,%3"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(plus:SI (ge:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			(match_operand:SI 2 "reg_or_short_operand" "rI"))
+		 (match_operand:SI 3 "gpc_reg_operand" "r")))
+   (clobber (match_scratch:SI 4 "=&r"))]
+  "TARGET_POWER"
+  "doz%I2 %4,%1,%2\;{sfi|subfic} %4,%4,0\;{aze|addze} %0,%3"
+  [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC
+	 (plus:SI (ge:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			 (match_operand:SI 2 "reg_or_short_operand" "rI"))
+		  (match_operand:SI 3 "gpc_reg_operand" "r"))
+	 (const_int 0)))
+   (clobber (match_scratch:SI 4 "=&r"))]
+  "TARGET_POWER"
+  "doz%I2 %4,%1,%2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %4,%3"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 5 "cc_reg_operand" "=x")
+	(compare:CC
+	 (plus:SI (ge:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			 (match_operand:SI 2 "reg_or_short_operand" "rI"))
+		  (match_operand:SI 3 "gpc_reg_operand" "r"))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(plus:SI (ge:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
+   (clobber (match_scratch:SI 4 "=&r"))]
+  "TARGET_POWER"
+  "doz%I2 %4,%1,%2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %0,%3"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(neg:SI (ge:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+		       (match_operand:SI 2 "reg_or_short_operand" "rI"))))]
+  "TARGET_POWER"
+  "doz%I2 %0,%1,%2\;{ai|addic} %0,%0,-1\;{sfe|subfe} %0,%0,%0"
+  [(set_attr "length" "12")])
+
+;; This is (and (neg (ge X (const_int 0))) Y).
+;; srawi sign-extends, so these patterrns are 64-bit safe.
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(and:SI (neg:SI
+		 (lshiftrt:SI
+		  (not:SI (match_operand:SI 1 "gpc_reg_operand" "r"))
+		  (const_int 31)))
+		(match_operand:SI 2 "gpc_reg_operand" "r")))
+   (clobber (match_scratch:SI 3 "=&r"))]
+  ""
+  "{srai|srawi} %3,%1,31\;andc %0,%2,%3"
+  [(set_attr "length" "8")])
+
+(define_insn ""
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(and:DI (neg:DI
+		 (lshiftrt:DI
+		  (not:DI (match_operand:DI 1 "gpc_reg_operand" "r"))
+		  (const_int 63)))
+		(match_operand:DI 2 "gpc_reg_operand" "r")))
+   (clobber (match_scratch:DI 3 "=&r"))]
+  "TARGET_POWERPC64"
+  "sradi %3,%1,63\;andc %0,%2,%3"
+  [(set_attr "length" "8")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC
+	 (and:SI (neg:SI
+		  (lshiftrt:SI
+		   (not:SI (match_operand:SI 1 "gpc_reg_operand" "r"))
+		   (const_int 31)))
+		 (match_operand:SI 2 "gpc_reg_operand" "r"))
+	 (const_int 0)))
+   (clobber (match_scratch:SI 3 "=&r"))]
+  ""
+  "{srai|srawi} %3,%1,31\;andc. %3,%2,%3"
+  [(set_attr "type" "compare")
+   (set_attr "length" "8")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC
+	 (and:DI (neg:DI
+		  (lshiftrt:DI
+		   (not:DI (match_operand:DI 1 "gpc_reg_operand" "r"))
+		   (const_int 63)))
+		 (match_operand:DI 2 "gpc_reg_operand" "r"))
+	 (const_int 0)))
+   (clobber (match_scratch:DI 3 "=&r"))]
+  "TARGET_POWERPC64"
+  "sradi %3,%1,63\;andc. %3,%2,%3"
+  [(set_attr "type" "compare")
+   (set_attr "length" "8")])
+
+(define_insn ""
+  [(set (match_operand:CC 4 "cc_reg_operand" "=x")
+	(compare:CC
+	 (and:SI (neg:SI
+		  (lshiftrt:SI
+		   (not:SI (match_operand:SI 1 "gpc_reg_operand" "r"))
+		   (const_int 31)))
+		 (match_operand:SI 2 "gpc_reg_operand" "r"))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(and:SI (neg:SI (lshiftrt:SI (not:SI (match_dup 1))
+				     (const_int 31)))
+		(match_dup 2)))
+   (clobber (match_scratch:SI 3 "=&r"))]
+  ""
+  "{srai|srawi} %3,%1,31\;andc. %0,%2,%3"
+  [(set_attr "type" "compare")
+   (set_attr "length" "8")])
+
+(define_insn ""
+  [(set (match_operand:CC 4 "cc_reg_operand" "=x")
+	(compare:CC
+	 (and:DI (neg:DI
+		  (lshiftrt:DI
+		   (not:DI (match_operand:DI 1 "gpc_reg_operand" "r"))
+		   (const_int 63)))
+		 (match_operand:DI 2 "gpc_reg_operand" "r"))
+	 (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(and:DI (neg:DI (lshiftrt:SI (not:DI (match_dup 1))
+				     (const_int 63)))
+		(match_dup 2)))
+   (clobber (match_scratch:SI 3 "=&r"))]
+  "TARGET_POWERPC64"
+  "sradi %3,%1,63\;andc. %0,%2,%3"
+  [(set_attr "type" "compare")
+   (set_attr "length" "8")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+		(match_operand:SI 2 "reg_or_neg_short_operand" "r,P")))]
+  "! TARGET_POWERPC64"
+  "@
+   {sf|subfc} %0,%2,%1\;{cal %0,0(0)|li %0,0}\;{ae|adde} %0,%0,%0
+   {ai|addic} %0,%1,%n2\;{cal %0,0(0)|li %0,0}\;{ae|adde} %0,%0,%0"
+  [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
+	(geu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
+		(match_operand:DI 2 "reg_or_neg_short_operand" "r,P")))]
+  "TARGET_POWERPC64"
+  "@
+   subfc %0,%2,%1\;li %0,0\;adde %0,%0,%0
+   addic %0,%1,%n2\;li %0,0\;adde %0,%0,%0"
+  [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x,x")
+	(compare:CC
+	 (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+		 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P"))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(geu:SI (match_dup 1) (match_dup 2)))]
+  "! TARGET_POWERPC64"
+  "@
+   {sf|subfc} %0,%2,%1\;{cal %0,0(0)|li %0,0}\;{ae.|adde.} %0,%0,%0
+   {ai|addic} %0,%1,%n2\;{cal %0,0(0)|li %0,0}\;{ae.|adde.} %0,%0,%0"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x,x")
+	(compare:CC
+	 (geu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
+		 (match_operand:DI 2 "reg_or_neg_short_operand" "r,P"))
+	 (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
+	(geu:DI (match_dup 1) (match_dup 2)))]
+  "TARGET_POWERPC64"
+  "@
+   subfc %0,%2,%1\;li %0,0\;adde. %0,%0,%0
+   addic %0,%1,%n2\;li %0,0\;adde. %0,%0,%0"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(plus:SI (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+			 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P"))
+		 (match_operand:SI 3 "gpc_reg_operand" "r,r")))
+   (clobber (match_scratch:SI 4 "=&r,&r"))]
+  "! TARGET_POWERPC64"
+  "@
+   {sf|subfc} %4,%2,%1\;{aze|addze} %0,%3
+   {ai|addic} %4,%1,%n2\;{aze|addze} %0,%3"
+  [(set_attr "length" "8")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x,x")
+	(compare:CC
+	 (plus:SI (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+			  (match_operand:SI 2 "reg_or_neg_short_operand" "r,P"))
+		  (match_operand:SI 3 "gpc_reg_operand" "r,r"))
+	 (const_int 0)))
+   (clobber (match_scratch:SI 4 "=&r,&r"))]
+  "! TARGET_POWERPC64"
+  "@
+   {sf|subfc} %4,%2,%1\;{aze.|addze.} %4,%3
+   {ai|addic} %4,%1,%n2\;{aze.|addze.} %4,%3"
+  [(set_attr "type" "compare")
+   (set_attr "length" "8")])
+
+(define_insn ""
+  [(set (match_operand:CC 5 "cc_reg_operand" "=x,x")
+	(compare:CC
+	 (plus:SI (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+			  (match_operand:SI 2 "reg_or_neg_short_operand" "r,P"))
+		  (match_operand:SI 3 "gpc_reg_operand" "r,r"))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(plus:SI (geu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
+   (clobber (match_scratch:SI 4 "=&r,&r"))]
+  "! TARGET_POWERPC64"
+  "@
+   {sf|subfc} %4,%2,%1\;{aze.|addze.} %0,%3
+   {ai|addic} %4,%1,%n2\;{aze.|addze.} %0,%3"
+  [(set_attr "type" "compare")
+   (set_attr "length" "8")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(neg:SI (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+			(match_operand:SI 2 "reg_or_short_operand" "r,I"))))]
+  "! TARGET_POWERPC64"
+  "@
+   {sf|subfc} %0,%2,%1\;{sfe|subfe} %0,%0,%0\;nand %0,%0,%0
+   {sfi|subfic} %0,%1,-1\;{a%I2|add%I2c} %0,%0,%2\;{sfe|subfe} %0,%0,%0"
+  [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(and:SI (neg:SI
+		 (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+			 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P")))
+		(match_operand:SI 3 "gpc_reg_operand" "r,r")))
+   (clobber (match_scratch:SI 4 "=&r,&r"))]
+  "! TARGET_POWERPC64"
+  "@
+   {sf|subfc} %4,%2,%1\;{sfe|subfe} %4,%4,%4\;andc %0,%3,%4
+   {ai|addic} %4,%1,%n2\;{sfe|subfe} %4,%4,%4\;andc %0,%3,%4"
+  [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x,x")
+	(compare:CC
+	 (and:SI (neg:SI
+		  (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+			  (match_operand:SI 2 "reg_or_neg_short_operand" "r,P")))
+		 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
+	 (const_int 0)))
+   (clobber (match_scratch:SI 4 "=&r,&r"))]
+  "! TARGET_POWERPC64"
+  "@
+   {sf|subfc} %4,%2,%1\;{sfe|subfe} %4,%4,%4\;andc. %4,%3,%4
+   {ai|addic} %4,%1,%n2\;{sfe|subfe} %4,%4,%4\;andc. %4,%3,%4"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 5 "cc_reg_operand" "=x,x")
+	(compare:CC
+	 (and:SI (neg:SI
+		  (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+			  (match_operand:SI 2 "reg_or_neg_short_operand" "r,P")))
+		 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(and:SI (neg:SI (geu:SI (match_dup 1) (match_dup 2))) (match_dup 3)))
+   (clobber (match_scratch:SI 4 "=&r,&r"))]
+  "! TARGET_POWERPC64"
+  "@
+   {sf|subfc} %4,%2,%1\;{sfe|subfe} %4,%4,%4\;andc. %0,%3,%4
+   {ai|addic} %4,%1,%n2\;{sfe|subfe} %4,%4,%4\;andc. %0,%3,%4"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+	       (const_int 0)))]
+  "! TARGET_POWERPC64"
+  "{sfi|subfic} %0,%1,0\;{ame|addme} %0,%0\;{sri|srwi} %0,%0,31"
+  [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(gt:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+	       (const_int 0)))]
+  "TARGET_POWERPC64"
+  "subfic %0,%1,0\;addme %0,%0\;srdi %0,%0,63"
+  [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 2 "cc_reg_operand" "=x")
+	(compare:CC
+	 (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+		(const_int 0))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(gt:SI (match_dup 1) (const_int 0)))]
+  "! TARGET_POWERPC64"
+  "{sfi|subfic} %0,%1,0\;{ame|addme} %0,%0\;{sri.|srwi.} %0,%0,31"
+  [(set_attr "type" "delayed_compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 2 "cc_reg_operand" "=x")
+	(compare:CC
+	 (gt:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+		(const_int 0))
+	 (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(gt:DI (match_dup 1) (const_int 0)))]
+  "TARGET_POWERPC64"
+  "subfic %0,%1,0\;addme %0,%0\;srdi. %0,%0,63"
+  [(set_attr "type" "delayed_compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+	       (match_operand:SI 2 "reg_or_short_operand" "r")))]
+  "TARGET_POWER"
+  "doz %0,%2,%1\;nabs %0,%0\;{sri|srwi} %0,%0,31"
+  [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC
+	 (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+		(match_operand:SI 2 "reg_or_short_operand" "r"))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(gt:SI (match_dup 1) (match_dup 2)))]
+  "TARGET_POWER"
+  "doz %0,%2,%1\;nabs %0,%0\;{sri.|srwi.} %0,%0,31"
+  [(set_attr "type" "delayed_compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			(const_int 0))
+		 (match_operand:SI 2 "gpc_reg_operand" "r")))
+   (clobber (match_scratch:SI 3 "=&r"))]
+  "! TARGET_POWERPC64"
+  "{a|addc} %3,%1,%1\;{sfe|subfe} %3,%1,%3\;{aze|addze} %0,%2"
+  [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(plus:DI (gt:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+			(const_int 0))
+		 (match_operand:DI 2 "gpc_reg_operand" "r")))
+   (clobber (match_scratch:DI 3 "=&r"))]
+  "TARGET_POWERPC64"
+  "addc %3,%1,%1\;subfe %3,%1,%3\;addze %0,%2"
+  [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC
+	 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			 (const_int 0))
+		  (match_operand:SI 2 "gpc_reg_operand" "r"))
+	 (const_int 0)))
+   (clobber (match_scratch:SI 3 "=&r"))]
+  "! TARGET_POWERPC64"
+  "{a|addc} %3,%1,%1\;{sfe|subfe} %3,%1,%3\;{aze.|addze.} %3,%2"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC
+	 (plus:DI (gt:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+			 (const_int 0))
+		  (match_operand:DI 2 "gpc_reg_operand" "r"))
+	 (const_int 0)))
+   (clobber (match_scratch:DI 3 "=&r"))]
+  "TARGET_POWERPC64"
+  "addc %3,%1,%1\;subfe %3,%1,%3\;addze. %3,%2"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 4 "cc_reg_operand" "=x")
+	(compare:CC
+	 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			 (const_int 0))
+		  (match_operand:SI 2 "gpc_reg_operand" "r"))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(plus:SI (gt:SI (match_dup 1) (const_int 0)) (match_dup 2)))
+   (clobber (match_scratch:SI 3 "=&r"))]
+  "! TARGET_POWERPC64"
+  "{a|addc} %3,%1,%1\;{sfe|subfe} %3,%1,%3\;{aze.|addze.} %0,%2"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 4 "cc_reg_operand" "=x")
+	(compare:CC
+	 (plus:DI (gt:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+			 (const_int 0))
+		  (match_operand:DI 2 "gpc_reg_operand" "r"))
+	 (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(plus:DI (gt:DI (match_dup 1) (const_int 0)) (match_dup 2)))
+   (clobber (match_scratch:DI 3 "=&r"))]
+  "TARGET_POWERPC64"
+  "addc %3,%1,%1\;subfe %3,%1,%3\;addze. %0,%2"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			(match_operand:SI 2 "reg_or_short_operand" "r"))
+		 (match_operand:SI 3 "gpc_reg_operand" "r")))
+   (clobber (match_scratch:SI 4 "=&r"))]
+  "TARGET_POWER"
+  "doz %4,%2,%1\;{ai|addic} %4,%4,-1\;{aze|addze} %0,%3"
+  [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x")
+	(compare:CC
+	 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			 (match_operand:SI 2 "reg_or_short_operand" "r"))
+		  (match_operand:SI 3 "gpc_reg_operand" "r"))
+	 (const_int 0)))
+   (clobber (match_scratch:SI 4 "=&r"))]
+  "TARGET_POWER"
+  "doz %4,%2,%1\;{ai|addic} %4,%4,-1\;{aze.|addze.} %4,%3"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 5 "cc_reg_operand" "=x")
+	(compare:CC
+	 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			 (match_operand:SI 2 "reg_or_short_operand" "r"))
+		  (match_operand:SI 3 "gpc_reg_operand" "r"))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(plus:SI (gt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
+   (clobber (match_scratch:SI 4 "=&r"))]
+  "TARGET_POWER"
+  "doz %4,%2,%1\;{ai|addic} %4,%4,-1\;{aze.|addze.} %0,%3"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(neg:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+		       (const_int 0))))]
+  "! TARGET_POWERPC64"
+  "{sfi|subfic} %0,%1,0\;{ame|addme} %0,%0\;{srai|srawi} %0,%0,31"
+  [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(neg:DI (gt:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+		       (const_int 0))))]
+  "TARGET_POWERPC64"
+  "subfic %0,%1,0\;addme %0,%0\;sradi} %0,%0,63"
+  [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(neg:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+		       (match_operand:SI 2 "reg_or_short_operand" "r"))))]
+  "TARGET_POWER"
+  "doz %0,%2,%1\;nabs %0,%0\;{srai|srawi} %0,%0,31"
+  [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+		(match_operand:SI 2 "reg_or_short_operand" "rI")))]
+  "! TARGET_POWERPC64"
+  "{sf%I2|subf%I2c} %0,%1,%2\;{sfe|subfe} %0,%0,%0\;neg %0,%0"
+  [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+		(match_operand:DI 2 "reg_or_short_operand" "rI")))]
+  "TARGET_POWERPC64"
+  "subf%I2c %0,%1,%2\;subfe %0,%0,%0\;neg %0,%0"
+  [(set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC
+	 (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+		 (match_operand:SI 2 "reg_or_short_operand" "rI"))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(gtu:SI (match_dup 1) (match_dup 2)))]
+  "! TARGET_POWERPC64"
+  "{sf%I2|subf%I2c} %0,%1,%2\;{sfe|subfe} %0,%0,%0\;neg. %0,%0"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:CC 3 "cc_reg_operand" "=x")
+	(compare:CC
+	 (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+		 (match_operand:DI 2 "reg_or_short_operand" "rI"))
+	 (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(gtu:DI (match_dup 1) (match_dup 2)))]
+  "TARGET_POWERPC64"
+  "subf%I2c %0,%1,%2\;subfe %0,%0,%0\;neg. %0,%0"
+  [(set_attr "type" "compare")
+   (set_attr "length" "12")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(plus:SI (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+			 (match_operand:SI 2 "reg_or_short_operand" "I,rI"))
+		 (match_operand:SI 3 "reg_or_short_operand" "r,rI")))
+   (clobber (match_scratch:SI 4 "=&r,&r"))]
+  "! TARGET_POWERPC64"
+  "@
+   {ai|addic} %4,%1,%k2\;{aze|addze} %0,%3
+   {sf%I2|subf%I2c} %4,%1,%2\;{sfe|subfe} %4,%4,%4\;{sf%I3|subf%I3c} %0,%4,%3"
+  [(set_attr "length" "8,12")])
+
+(define_insn ""
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
+	(plus:DI (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
+			 (match_operand:DI 2 "reg_or_short_operand" "I,rI"))
+		 (match_operand:DI 3 "reg_or_short_operand" "r,rI")))
+   (clobber (match_scratch:DI 4 "=&r,&r"))]
+  "TARGET_POWERPC64"
+  "@
+   addic %4,%1,%k2\;addze %0,%3
+   subf%I2c %4,%1,%2\;subfe %4,%4,%4\;subf%I3c %0,%4,%3"
+  [(set_attr "length" "8,12")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x,x")
+	(compare:CC
+	 (plus:SI (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+			  (match_operand:SI 2 "reg_or_short_operand" "I,r"))
+		  (match_operand:SI 3 "gpc_reg_operand" "r,r"))
+	 (const_int 0)))
+   (clobber (match_scratch:SI 4 "=&r,&r"))]
+  "! TARGET_POWERPC64"
+  "@
+   {ai|addic} %4,%1,%k2\;{aze.|addze.} %4,%3
+   {sf%I2|subf%I2c} %4,%1,%2\;{sfe|subfe} %4,%4,%4\;{sf.|subfc.} %4,%4,%3"
+  [(set_attr "type" "compare")
+   (set_attr "length" "8,12")])
+
+(define_insn ""
+  [(set (match_operand:CC 0 "cc_reg_operand" "=x,x")
+	(compare:CC
+	 (plus:DI (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
+			  (match_operand:DI 2 "reg_or_short_operand" "I,r"))
+		  (match_operand:DI 3 "gpc_reg_operand" "r,r"))
+	 (const_int 0)))
+   (clobber (match_scratch:DI 4 "=&r,&r"))]
+  "TARGET_POWERPC64"
+  "@
+   addic %4,%1,%k2\;addze. %4,%3
+   subf%I2c %4,%1,%2\;subfe %4,%4,%4\;subfc. %4,%4,%3"
+  [(set_attr "type" "compare")
+   (set_attr "length" "8,12")])
+
+(define_insn ""
+  [(set (match_operand:CC 5 "cc_reg_operand" "=x,x")
+	(compare:CC
+	 (plus:SI (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
+			  (match_operand:SI 2 "reg_or_short_operand" "I,r"))
+		  (match_operand:SI 3 "gpc_reg_operand" "r,r"))
+	 (const_int 0)))
+   (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+	(plus:SI (gtu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
+   (clobber (match_scratch:SI 4 "=&r,&r"))]
+  "! TARGET_POWERPC64"
+  "@
+   {ai|addic} %4,%1,%k2\;{aze.|addze.} %0,%3
+   {sf%I2|subf%I2c} %4,%1,%2\;{sfe|subfe} %4,%4,%4\;{sf.|subfc.} %0,%4,%3"
+  [(set_attr "type" "compare")
+   (set_attr "length" "8,12")])
+
+(define_insn ""
+  [(set (match_operand:CC 5 "cc_reg_operand" "=x,x")
+	(compare:CC
+	 (plus:DI (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
+			  (match_operand:DI 2 "reg_or_short_operand" "I,r"))
+		  (match_operand:DI 3 "gpc_reg_operand" "r,r"))
+	 (const_int 0)))
+   (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
+	(plus:DI (gtu:DI (match_dup 1) (match_dup 2)) (match_dup 3)))
+   (clobber (match_scratch:DI 4 "=&r,&r"))]
+  "TARGET_POWERPC64"
+  "@
+   addic %4,%1,%k2\;addze. %0,%3
+   subf%I2c %4,%1,%2\;subfe %4,%4,%4\;subfc. %0,%4,%3"
+  [(set_attr "type" "compare")
+   (set_attr "length" "8,12")])
+
+(define_insn ""
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+	(neg:SI (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+			(match_operand:SI 2 "reg_or_short_operand" "rI"))))]
+  "! TARGET_POWERPC64"
+  "{sf%I2|subf%I2c} %0,%1,%2\;{sfe|subfe} %0,%0,%0"
+  [(set_attr "length" "8")])
+
+(define_insn ""
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+	(neg:DI (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+			(match_operand:DI 2 "reg_or_short_operand" "rI"))))]
+  "TARGET_POWERPC64"
+  "subf%I2c %0,%1,%2\;subfe %0,%0,%0"
+  [(set_attr "length" "8")])
+
+;; Define both directions of branch and return.  If we need a reload
+;; register, we'd rather use CR0 since it is much easier to copy a
+;; register CC value to there.
+
+(define_insn ""
+  [(set (pc)
+	(if_then_else (match_operator 1 "branch_comparison_operator"
+				      [(match_operand 2
+						      "cc_reg_operand" "x,?y")
+				       (const_int 0)])
+		      (label_ref (match_operand 0 "" ""))
+		      (pc)))]
+  ""
+  "*
+{
+  if (get_attr_length (insn) == 8)
+    return \"%C1bc %t1,%j1,%l0\";
+  else
+    return \"%C1bc %T1,%j1,%$+8\;b %l0\";
+
+}"
+  [(set_attr "type" "branch")])
+
+(define_insn ""
+  [(set (pc)
+	(if_then_else (match_operator 0 "branch_comparison_operator"
+				      [(match_operand 1
+						      "cc_reg_operand" "x,?y")
+				       (const_int 0)])
+		      (return)
+		      (pc)))]
+  "direct_return ()"
+  "{%C0bcr|%C0bclr} %t0,%j0"
+  [(set_attr "type" "branch")
+   (set_attr "length" "8")])
+
+(define_insn ""
+  [(set (pc)
+	(if_then_else (match_operator 1 "branch_comparison_operator"
+				      [(match_operand 2
+						      "cc_reg_operand" "x,?y")
+				       (const_int 0)])
+		      (pc)
+		      (label_ref (match_operand 0 "" ""))))]
+  ""
+  "*
+{
+  if (get_attr_length (insn) == 8)
+    return \"%C1bc %T1,%j1,%l0\";
+  else
+    return \"%C1bc %t1,%j1,%$+8\;b %l0\";
+}"
+  [(set_attr "type" "branch")])
+
+(define_insn ""
+  [(set (pc)
+	(if_then_else (match_operator 0 "branch_comparison_operator"
+				      [(match_operand 1
+						      "cc_reg_operand" "x,?y")
+				       (const_int 0)])
+		      (pc)
+		      (return)))]
+  "direct_return ()"
+  "{%C0bcr|%C0bclr} %T0,%j0"
+  [(set_attr "type" "branch")
+   (set_attr "length" "8")])
+
+;; Unconditional branch and return.
+
+(define_insn "jump"
+  [(set (pc)
+	(label_ref (match_operand 0 "" "")))]
+  ""
+  "b %l0"
+  [(set_attr "type" "branch")])
+
+(define_insn "return"
+  [(return)]
+  "direct_return ()"
+  "{br|blr}"
+  [(set_attr "type" "jmpreg")])
+
+(define_expand "indirect_jump"
+  [(set (pc) (match_operand 0 "register_operand" ""))]
+  ""
+  "
+{
+  if (TARGET_32BIT)
+    emit_jump_insn (gen_indirect_jumpsi (operands[0]));
+  else
+    emit_jump_insn (gen_indirect_jumpdi (operands[0]));
+  DONE;
+}")
+
+(define_insn "indirect_jumpsi"
+  [(set (pc) (match_operand:SI 0 "register_operand" "c,l"))]
+  "TARGET_32BIT"
+  "@
+   bctr
+   {br|blr}"
+  [(set_attr "type" "jmpreg")])
+
+(define_insn "indirect_jumpdi"
+  [(set (pc) (match_operand:DI 0 "register_operand" "c,l"))]
+  "TARGET_64BIT"
+  "@
+   bctr
+   {br|blr}"
+  [(set_attr "type" "jmpreg")])
+
+;; Table jump for switch statements:
+(define_expand "tablejump"
+  [(use (match_operand 0 "" ""))
+   (use (label_ref (match_operand 1 "" "")))]
+  ""
+  "
+{
+  if (TARGET_32BIT)
+    emit_jump_insn (gen_tablejumpsi (operands[0], operands[1]));
+  else
+    emit_jump_insn (gen_tablejumpdi (operands[0], operands[1]));
+  DONE;
+}")
+
+(define_expand "tablejumpsi"
+  [(set (match_dup 3)
+	(plus:SI (match_operand:SI 0 "" "")
+		 (match_dup 2)))
+   (parallel [(set (pc) (match_dup 3))
+	      (use (label_ref (match_operand 1 "" "")))])]
+  "TARGET_32BIT"
+  "
+{ operands[0] = force_reg (SImode, operands[0]);
+  operands[2] = force_reg (SImode, gen_rtx_LABEL_REF (VOIDmode, operands[1]));
+  operands[3] = gen_reg_rtx (SImode);
+}")
+
+(define_expand "tablejumpdi"
+  [(set (match_dup 3)
+	(plus:DI (match_operand:DI 0 "" "")
+		 (match_dup 2)))
+   (parallel [(set (pc) (match_dup 3))
+	      (use (label_ref (match_operand 1 "" "")))])]
+  "TARGET_64BIT"
+  "
+{ operands[0] = force_reg (DImode, operands[0]);
+  operands[2] = force_reg (DImode, gen_rtx_LABEL_REF (VOIDmode, operands[1]));
+  operands[3] = gen_reg_rtx (DImode);
+}")
+
+(define_insn ""
+  [(set (pc)
+	(match_operand:SI 0 "register_operand" "c,l"))
+   (use (label_ref (match_operand 1 "" "")))]
+  "TARGET_32BIT"
+  "@
+   bctr
+   {br|blr}"
+  [(set_attr "type" "jmpreg")])
+
+(define_insn ""
+  [(set (pc)
+	(match_operand:DI 0 "register_operand" "c,l"))
+   (use (label_ref (match_operand 1 "" "")))]
+  "TARGET_64BIT"
+  "@
+   bctr
+   {br|blr}"
+  [(set_attr "type" "jmpreg")])
+
+(define_insn "nop"
+  [(const_int 0)]
+  ""
+  "{cror 0,0,0|nop}")
+
+;; Define the subtract-one-and-jump insns, starting with the template
+;; so loop.c knows what to generate.
+
+(define_expand "decrement_and_branch_on_count"
+  [(use (match_operand 0 "register_operand" ""))
+   (use (label_ref (match_operand 1 "" "")))]
+  ""
+  "
+{
+  if (TARGET_POWERPC64)
+    emit_jump_insn (gen_ctrdi (operands[0], operands[1]));
+  else
+    emit_jump_insn (gen_ctrsi (operands[0], operands[1]));
+  DONE;
+}")
+
+(define_expand "ctrsi"
+  [(parallel [(set (pc) (if_then_else (ne (match_operand:SI 0 "register_operand" "")
+					  (const_int 1))
+				      (label_ref (match_operand 1 "" ""))
+				      (pc)))
+	      (set (match_dup 0)
+		   (plus:SI (match_dup 0)
+			    (const_int -1)))
+	      (clobber (match_scratch:CC 2 ""))
+	      (clobber (match_scratch:SI 3 ""))])]
+  "! TARGET_POWERPC64"
+  "")
+
+(define_expand "ctrdi"
+  [(parallel [(set (pc) (if_then_else (ne (match_operand:DI 0 "register_operand" "")
+					  (const_int 1))
+				      (label_ref (match_operand 1 "" ""))
+				      (pc)))
+	      (set (match_dup 0)
+		   (plus:DI (match_dup 0)
+			    (const_int -1)))
+	      (clobber (match_scratch:CC 2 ""))
+	      (clobber (match_scratch:DI 3 ""))])]
+  "TARGET_POWERPC64"
+  "")
+
+;; We need to be able to do this for any operand, including MEM, or we
+;; will cause reload to blow up since we don't allow output reloads on
+;; JUMP_INSNs.
+;; For the length attribute to be calculated correctly, the
+;; label MUST be operand 0.
+
+(define_insn "*ctrsi_internal1"
+  [(set (pc)
+	(if_then_else (ne (match_operand:SI 1 "register_operand" "c,*r,*r")
+			  (const_int 1))
+		      (label_ref (match_operand 0 "" ""))
+		      (pc)))
+   (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l")
+	(plus:SI (match_dup 1)
+		 (const_int -1)))
+   (clobber (match_scratch:CC 3 "=X,&x,&x"))
+   (clobber (match_scratch:SI 4 "=X,X,r"))]
+  "! TARGET_POWERPC64"
+  "*
+{
+  if (which_alternative != 0)
+    return \"#\";
+  else if (get_attr_length (insn) == 8)
+    return \"{bdn|bdnz} %l0\";
+  else
+    return \"bdz %$+8\;b %l0\";
+}"
+  [(set_attr "type" "branch")
+   (set_attr "length" "*,12,16")])
+
+(define_insn "*ctrsi_internal2"
+  [(set (pc)
+	(if_then_else (ne (match_operand:SI 1 "register_operand" "c,*r,*r")
+			  (const_int 1))
+		      (pc)
+		      (label_ref (match_operand 0 "" ""))))
+   (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l")
+	(plus:SI (match_dup 1)
+		 (const_int -1)))
+   (clobber (match_scratch:CC 3 "=X,&x,&x"))
+   (clobber (match_scratch:SI 4 "=X,X,r"))]
+  "! TARGET_POWERPC64"
+  "*
+{
+  if (which_alternative != 0)
+    return \"#\";
+  else if (get_attr_length (insn) == 8)
+    return \"bdz %l0\";
+  else
+    return \"{bdn|bdnz} %$+8\;b %l0\";
+}"
+  [(set_attr "type" "branch")
+   (set_attr "length" "*,12,16")])
+
+(define_insn "*ctrdi_internal1"
+  [(set (pc)
+	(if_then_else (ne (match_operand:DI 1 "register_operand" "c,*r,*r")
+			  (const_int 1))
+		      (label_ref (match_operand 0 "" ""))
+		      (pc)))
+   (set (match_operand:DI 2 "register_operand" "=1,*r,m*q*c*l")
+	(plus:DI (match_dup 1)
+		 (const_int -1)))
+   (clobber (match_scratch:CC 3 "=X,&x,&x"))
+   (clobber (match_scratch:DI 4 "=X,X,r"))]
+  "TARGET_POWERPC64"
+  "*
+{
+  if (which_alternative != 0)
+    return \"#\";
+  else if (get_attr_length (insn) == 8)
+    return \"{bdn|bdnz} %l0\";
+  else
+    return \"bdz %$+8\;b %l0\";
+}"
+  [(set_attr "type" "branch")
+   (set_attr "length" "*,12,16")])
+
+(define_insn "*ctrdi_internal2"
+  [(set (pc)
+	(if_then_else (ne (match_operand:DI 1 "register_operand" "c,*r,*r")
+			  (const_int 1))
+		      (pc)
+		      (label_ref (match_operand 0 "" ""))))
+   (set (match_operand:DI 2 "register_operand" "=1,*r,m*q*c*l")
+	(plus:DI (match_dup 1)
+		 (const_int -1)))
+   (clobber (match_scratch:CC 3 "=X,&x,&x"))
+   (clobber (match_scratch:DI 4 "=X,X,r"))]
+  "TARGET_POWERPC64"
+  "*
+{
+  if (which_alternative != 0)
+    return \"#\";
+  else if (get_attr_length (insn) == 8)
+    return \"bdz %l0\";
+  else
+    return \"{bdn|bdnz} %$+8\;b %l0\";
+}"
+  [(set_attr "type" "branch")
+   (set_attr "length" "*,12,16")])
+
+;; Similar, but we can use GE since we have a REG_NONNEG.
+
+(define_insn "*ctrsi_internal3"
+  [(set (pc)
+	(if_then_else (ge (match_operand:SI 1 "register_operand" "c,*r,*r")
+			  (const_int 0))
+		      (label_ref (match_operand 0 "" ""))
+		      (pc)))
+   (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l")
+	(plus:SI (match_dup 1)
+		 (const_int -1)))
+   (clobber (match_scratch:CC 3 "=X,&x,&X"))
+   (clobber (match_scratch:SI 4 "=X,X,r"))]
+  "! TARGET_POWERPC64 && find_reg_note (insn, REG_NONNEG, 0)"
+  "*
+{
+  if (which_alternative != 0)
+    return \"#\";
+  else if (get_attr_length (insn) == 8)
+    return \"{bdn|bdnz} %l0\";
+  else
+    return \"bdz %$+8\;b %l0\";
+}"
+  [(set_attr "type" "branch")
+   (set_attr "length" "*,12,16")])
+
+(define_insn "*ctrsi_internal4"
+  [(set (pc)
+	(if_then_else (ge (match_operand:SI 1 "register_operand" "c,*r,*r")
+			  (const_int 0))
+		      (pc)
+		      (label_ref (match_operand 0 "" ""))))
+   (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l")
+	(plus:SI (match_dup 1)
+		 (const_int -1)))
+   (clobber (match_scratch:CC 3 "=X,&x,&X"))
+   (clobber (match_scratch:SI 4 "=X,X,r"))]
+  "! TARGET_POWERPC64 && find_reg_note (insn, REG_NONNEG, 0)"
+  "*
+{
+  if (which_alternative != 0)
+    return \"#\";
+  else if (get_attr_length (insn) == 8)
+    return \"bdz %l0\";
+  else
+    return \"{bdn|bdnz} %$+8\;b %l0\";
+}"
+  [(set_attr "type" "branch")
+   (set_attr "length" "*,12,16")])
+
+(define_insn "*ctrdi_internal3"
+  [(set (pc)
+	(if_then_else (ge (match_operand:DI 1 "register_operand" "c,*r,*r")
+			  (const_int 0))
+		      (label_ref (match_operand 0 "" ""))
+		      (pc)))
+   (set (match_operand:DI 2 "register_operand" "=1,*r,m*q*c*l")
+	(plus:DI (match_dup 1)
+		 (const_int -1)))
+   (clobber (match_scratch:CC 3 "=X,&x,&X"))
+   (clobber (match_scratch:DI 4 "=X,X,r"))]
+  "TARGET_POWERPC64 && find_reg_note (insn, REG_NONNEG, 0)"
+  "*
+{
+  if (which_alternative != 0)
+    return \"#\";
+  else if (get_attr_length (insn) == 8)
+    return \"{bdn|bdnz} %l0\";
+  else
+    return \"bdz %$+8\;b %l0\";
+}"
+  [(set_attr "type" "branch")
+   (set_attr "length" "*,12,16")])
+
+(define_insn "*ctrdi_internal4"
+  [(set (pc)
+	(if_then_else (ge (match_operand:DI 1 "register_operand" "c,*r,*r")
+			  (const_int 0))
+		      (pc)
+		      (label_ref (match_operand 0 "" ""))))
+   (set (match_operand:DI 2 "register_operand" "=1,*r,m*q*c*l")
+	(plus:DI (match_dup 1)
+		 (const_int -1)))
+   (clobber (match_scratch:CC 3 "=X,&x,&X"))
+   (clobber (match_scratch:DI 4 "=X,X,r"))]
+  "TARGET_POWERPC64 && find_reg_note (insn, REG_NONNEG, 0)"
+  "*
+{
+  if (which_alternative != 0)
+    return \"#\";
+  else if (get_attr_length (insn) == 8)
+    return \"bdz %l0\";
+  else
+    return \"{bdn|bdnz} %$+8\;b %l0\";
+}"
+  [(set_attr "type" "branch")
+   (set_attr "length" "*,12,16")])
+
+;; Similar but use EQ
+
+(define_insn "*ctrsi_internal5"
+  [(set (pc)
+	(if_then_else (eq (match_operand:SI 1 "register_operand" "c,*r,*r")
+			  (const_int 1))
+		      (label_ref (match_operand 0 "" ""))
+		      (pc)))
+   (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l")
+	(plus:SI (match_dup 1)
+		 (const_int -1)))
+   (clobber (match_scratch:CC 3 "=X,&x,&x"))
+   (clobber (match_scratch:SI 4 "=X,X,r"))]
+  "! TARGET_POWERPC64"
+  "*
+{
+  if (which_alternative != 0)
+    return \"#\";
+  else if (get_attr_length (insn) == 8)
+    return \"bdz %l0\";
+  else
+    return \"{bdn|bdnz} %$+8\;b %l0\";
+}"
+  [(set_attr "type" "branch")
+   (set_attr "length" "*,12,16")])
+
+(define_insn "*ctrsi_internal6"
+  [(set (pc)
+	(if_then_else (eq (match_operand:SI 1 "register_operand" "c,*r,*r")
+			  (const_int 1))
+		      (pc)
+		      (label_ref (match_operand 0 "" ""))))
+   (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l")
+	(plus:SI (match_dup 1)
+		 (const_int -1)))
+   (clobber (match_scratch:CC 3 "=X,&x,&x"))
+   (clobber (match_scratch:SI 4 "=X,X,r"))]
+  "! TARGET_POWERPC64"
+  "*
+{
+  if (which_alternative != 0)
+    return \"#\";
+  else if (get_attr_length (insn) == 8)
+    return \"{bdn|bdnz} %l0\";
+  else
+    return \"bdz %$+8\;b %l0\";
+}"
+  [(set_attr "type" "branch")
+   (set_attr "length" "*,12,16")])
+
+(define_insn "*ctrdi_internal5"
+  [(set (pc)
+	(if_then_else (eq (match_operand:DI 1 "register_operand" "c,*r,*r")
+			  (const_int 1))
+		      (label_ref (match_operand 0 "" ""))
+		      (pc)))
+   (set (match_operand:DI 2 "register_operand" "=1,*r,m*q*c*l")
+	(plus:DI (match_dup 1)
+		 (const_int -1)))
+   (clobber (match_scratch:CC 3 "=X,&x,&x"))
+   (clobber (match_scratch:DI 4 "=X,X,r"))]
+  "TARGET_POWERPC64"
+  "*
+{
+  if (which_alternative != 0)
+    return \"#\";
+  else if (get_attr_length (insn) == 8)
+    return \"bdz %l0\";
+  else
+    return \"{bdn|bdnz} %$+8\;b %l0\";
+}"
+  [(set_attr "type" "branch")
+   (set_attr "length" "*,12,16")])
+
+(define_insn "*ctrdi_internal6"
+  [(set (pc)
+	(if_then_else (eq (match_operand:DI 1 "register_operand" "c,*r,*r")
+			  (const_int 1))
+		      (pc)
+		      (label_ref (match_operand 0 "" ""))))
+   (set (match_operand:DI 2 "register_operand" "=1,*r,m*q*c*l")
+	(plus:DI (match_dup 1)
+		 (const_int -1)))
+   (clobber (match_scratch:CC 3 "=X,&x,&x"))
+   (clobber (match_scratch:DI 4 "=X,X,r"))]
+  "TARGET_POWERPC64"
+  "*
+{
+  if (which_alternative != 0)
+    return \"#\";
+  else if (get_attr_length (insn) == 8)
+    return \"{bdn|bdnz} %l0\";
+  else
+    return \"bdz %$+8\;b %l0\";
+}"
+  [(set_attr "type" "branch")
+   (set_attr "length" "*,12,16")])
+
+;; Now the splitters if we could not allocate the CTR register
+
+(define_split
+  [(set (pc)
+	(if_then_else (match_operator 2 "comparison_operator"
+				      [(match_operand:SI 1 "gpc_reg_operand" "")
+				       (const_int 1)])
+		      (match_operand 5 "" "")
+		      (match_operand 6 "" "")))
+   (set (match_operand:SI 0 "gpc_reg_operand" "")
+	(plus:SI (match_dup 1)
+		 (const_int -1)))
+   (clobber (match_scratch:CC 3 ""))
+   (clobber (match_scratch:SI 4 ""))]
+  "! TARGET_POWERPC64 && reload_completed"
+  [(parallel [(set (match_dup 3)
+		   (compare:CC (plus:SI (match_dup 1)
+					(const_int -1))
+			       (const_int 0)))
+	      (set (match_dup 0)
+		   (plus:SI (match_dup 1)
+			    (const_int -1)))])
+   (set (pc) (if_then_else (match_dup 7)
+			   (match_dup 5)
+			   (match_dup 6)))]
+  "
+{ operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3],
+			 const0_rtx); }")
+
+(define_split
+  [(set (pc)
+	(if_then_else (match_operator 2 "comparison_operator"
+				      [(match_operand:SI 1 "gpc_reg_operand" "")
+				       (const_int 1)])
+		      (match_operand 5 "" "")
+		      (match_operand 6 "" "")))
+   (set (match_operand:SI 0 "general_operand" "")
+	(plus:SI (match_dup 1) (const_int -1)))
+   (clobber (match_scratch:CC 3 ""))
+   (clobber (match_scratch:SI 4 ""))]
+  "! TARGET_POWERPC64 && reload_completed
+   && ! gpc_reg_operand (operands[0], SImode)"
+  [(parallel [(set (match_dup 3)
+		   (compare:CC (plus:SI (match_dup 1)
+					(const_int -1))
+			       (const_int 0)))
+	      (set (match_dup 4)
+		   (plus:SI (match_dup 1)
+			    (const_int -1)))])
+   (set (match_dup 0)
+	(match_dup 4))
+   (set (pc) (if_then_else (match_dup 7)
+			   (match_dup 5)
+			   (match_dup 6)))]
+  "
+{ operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3],
+			 const0_rtx); }")
+(define_split
+  [(set (pc)
+	(if_then_else (match_operator 2 "comparison_operator"
+				      [(match_operand:DI 1 "gpc_reg_operand" "")
+				       (const_int 1)])
+		      (match_operand 5 "" "")
+		      (match_operand 6 "" "")))
+   (set (match_operand:DI 0 "gpc_reg_operand" "")
+	(plus:DI (match_dup 1)
+		 (const_int -1)))
+   (clobber (match_scratch:CC 3 ""))
+   (clobber (match_scratch:DI 4 ""))]
+  "TARGET_POWERPC64 && reload_completed"
+  [(parallel [(set (match_dup 3)
+		   (compare:CC (plus:DI (match_dup 1)
+					(const_int -1))
+			       (const_int 0)))
+	      (set (match_dup 0)
+		   (plus:DI (match_dup 1)
+			    (const_int -1)))])
+   (set (pc) (if_then_else (match_dup 7)
+			   (match_dup 5)
+			   (match_dup 6)))]
+  "
+{ operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3],
+			 const0_rtx); }")
+
+(define_split
+  [(set (pc)
+	(if_then_else (match_operator 2 "comparison_operator"
+				      [(match_operand:DI 1 "gpc_reg_operand" "")
+				       (const_int 1)])
+		      (match_operand 5 "" "")
+		      (match_operand 6 "" "")))
+   (set (match_operand:DI 0 "general_operand" "")
+	(plus:DI (match_dup 1) (const_int -1)))
+   (clobber (match_scratch:CC 3 ""))
+   (clobber (match_scratch:DI 4 ""))]
+  "TARGET_POWERPC64 && reload_completed
+   && ! gpc_reg_operand (operands[0], DImode)"
+  [(parallel [(set (match_dup 3)
+		   (compare:CC (plus:DI (match_dup 1)
+					(const_int -1))
+			       (const_int 0)))
+	      (set (match_dup 4)
+		   (plus:DI (match_dup 1)
+			    (const_int -1)))])
+   (set (match_dup 0)
+	(match_dup 4))
+   (set (pc) (if_then_else (match_dup 7)
+			   (match_dup 5)
+			   (match_dup 6)))]
+  "
+{ operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3],
+			 const0_rtx); }")
+
+(define_insn "trap"
+  [(trap_if (const_int 1) (const_int 0))]
+  ""
+  "{t 31,0,0|trap}")
+
+(define_expand "conditional_trap"
+  [(trap_if (match_operator 0 "trap_comparison_operator"
+			    [(match_dup 2) (match_dup 3)])
+	    (match_operand 1 "const_int_operand" ""))]
+  ""
+  "if (rs6000_compare_fp_p || operands[1] != const0_rtx) FAIL;
+   operands[2] = rs6000_compare_op0;
+   operands[3] = rs6000_compare_op1;")
+
+(define_insn ""
+  [(trap_if (match_operator 0 "trap_comparison_operator"
+                            [(match_operand:SI 1 "register_operand" "r")
+                             (match_operand:SI 2 "reg_or_short_operand" "rI")])
+	    (const_int 0))]
+  ""
+  "t%V0%I2 %1,%2")
diff -urNEBb gcc-2.95.3-orig/gcc/config/rs6000/sol2.h gcc-2.95.3/gcc/config/rs6000/sol2.h
--- gcc-2.95.3-orig/gcc/config/rs6000/sol2.h	1999-01-11 14:34:11.000000000 +0100
+++ gcc-2.95.3/gcc/config/rs6000/sol2.h	2003-12-06 18:30:48.000000000 +0100
@@ -60,7 +60,7 @@
 #define	CPP_OS_DEFAULT_SPEC "%(cpp_os_solaris)"
 
 #undef	LINK_OS_DEFAULT_SPEC
-#define	LINK_OS_DEFAULT_SPEC "%(link_os_solaris)"
+#define	LINK_OS_DEFAULT_SPEC "-L/gcc/local/lib"
 
 #undef	CPP_ENDIAN_LITTLE_SPEC
 #define	CPP_ENDIAN_LITTLE_SPEC CPP_ENDIAN_SOLARIS_SPEC
diff -urNEBb gcc-2.95.3-orig/gcc/config/rs6000/t-amigaos gcc-2.95.3/gcc/config/rs6000/t-amigaos
--- gcc-2.95.3-orig/gcc/config/rs6000/t-amigaos	1970-01-01 01:00:00.000000000 +0100
+++ gcc-2.95.3/gcc/config/rs6000/t-amigaos	2003-12-06 20:01:51.000000000 +0100
@@ -0,0 +1,27 @@
+# Do not build libgcc1.
+LIBGCC1 =
+CROSS_LIBGCC1 =
+
+# These are really part of libgcc1, but this will cause them to be
+# built correctly, so... [taken from t-sparclite]
+LIB2FUNCS_EXTRA = fp-bit.c dp-bit.c
+
+dp-bit.c: $(srcdir)/config/fp-bit.c
+	cat $(srcdir)/config/fp-bit.c > dp-bit.c
+
+fp-bit.c: $(srcdir)/config/fp-bit.c
+	echo '#define FLOAT' > fp-bit.c
+	cat $(srcdir)/config/fp-bit.c >> fp-bit.c
+
+amigaos.o: $(srcdir)/config/rs6000/amigaos.c
+	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
+
+# Build the libraries for both hard and soft floating point
+
+MULTILIB_OPTIONS = msoft-float mcpu=common
+MULTILIB_DIRNAMES = soft-float common
+
+SYSTEM_HEADER_DIR=gcc:os-include
+
+# FIXME: do this
+USE_COLLECT2 =
diff -urNEBb gcc-2.95.3-orig/gcc/config/rs6000/xm-amigaos.h gcc-2.95.3/gcc/config/rs6000/xm-amigaos.h
--- gcc-2.95.3-orig/gcc/config/rs6000/xm-amigaos.h	1970-01-01 01:00:00.000000000 +0100
+++ gcc-2.95.3/gcc/config/rs6000/xm-amigaos.h	2003-12-04 13:58:52.000000000 +0100
@@ -0,0 +1,31 @@
+/* Configuration for GNU C-compiler for AmigaOS host.
+   Copyright (C) 1997 Free Software Foundation, Inc.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING.  If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#include "rs6000/xm-sysv4.h"
+
+#define STANDARD_INCLUDE_DIR "/gcc/include"
+#define SYSTEM_INCLUDE_DIR "/gcc/os-include"
+
+#define DIR_SEPERATOR '/'
+
+#define PATH_SEPERATOR ';'
+
+#undef HAVE_GETWD
+#undef HAVE_SYS_WAIT_H
diff -urNEBb gcc-2.95.3-orig/gcc/config/rs6000/xm-macosx.h gcc-2.95.3/gcc/config/rs6000/xm-macosx.h
--- gcc-2.95.3-orig/gcc/config/rs6000/xm-macosx.h	1970-01-01 01:00:00.000000000 +0100
+++ gcc-2.95.3/gcc/config/rs6000/xm-macosx.h	2003-12-02 17:50:55.000000000 +0100
@@ -0,0 +1,3 @@
+#include "rs6000/xm-rs6000.h"
+
+#undef USG
diff -urNEBb gcc-2.95.3-orig/gcc/config.in gcc-2.95.3/gcc/config.in
--- gcc-2.95.3-orig/gcc/config.in	2001-03-16 15:13:48.000000000 +0100
+++ gcc-2.95.3/gcc/config.in	2003-12-03 14:00:10.000000000 +0100
@@ -1,4 +1,4 @@
-/* config.in.  Generated automatically from configure.in by autoheader.  */
+/* config.in.  Generated from configure.in by autoheader.  */
 /* Define if you can safely include both <string.h> and <strings.h>.  */
 #undef STRING_WITH_STRINGS
 
@@ -130,237 +130,283 @@
 /* Define to the version of the distribution.  */
 #undef VERSION
 
-/* Define if using alloca.c.  */
-#undef C_ALLOCA
-
-/* Define to empty if the keyword does not work.  */
-#undef const
-
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
-   This function is required for alloca.c support on those systems.  */
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+   systems. This function is required for `alloca.c' support on those systems.
+   */
 #undef CRAY_STACKSEG_END
 
-/* Define if you have alloca, as a function or macro.  */
-#undef HAVE_ALLOCA
-
-/* Define if you have <alloca.h> and it should be used (not on Ultrix).  */
-#undef HAVE_ALLOCA_H
-
-/* Define if you don't have vprintf but do have _doprnt.  */
-#undef HAVE_DOPRNT
-
-/* Define if you have a working `mmap' system call.  */
-#undef HAVE_MMAP
-
-/* Define if you have <sys/wait.h> that is POSIX.1 compatible.  */
-#undef HAVE_SYS_WAIT_H
-
-/* Define if you have <vfork.h>.  */
-#undef HAVE_VFORK_H
-
-/* Define if you have the vprintf function.  */
-#undef HAVE_VPRINTF
-
-/* Define as __inline if that's what the C compiler calls it.  */
-#undef inline
-
-/* Define to `long' if <sys/types.h> doesn't define.  */
-#undef off_t
-
-/* Define to `int' if <sys/types.h> doesn't define.  */
-#undef pid_t
+/* Define to 1 if using `alloca.c'. */
+#undef C_ALLOCA
 
-/* Define to `unsigned' if <sys/types.h> doesn't define.  */
-#undef size_t
+/* Define to 1 if you have `alloca', as a function or macro. */
+#undef HAVE_ALLOCA
 
-/* If using the C implementation of alloca, define if you know the
-   direction of stack growth for your system; otherwise it will be
-   automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
  */
-#undef STACK_DIRECTION
-
-/* Define if you have the ANSI C header files.  */
-#undef STDC_HEADERS
-
-/* Define if `sys_siglist' is declared by <signal.h>.  */
-#undef SYS_SIGLIST_DECLARED
-
-/* Define if you can safely include both <sys/time.h> and <time.h>.  */
-#undef TIME_WITH_SYS_TIME
-
-/* Define vfork as fork if vfork does not work.  */
-#undef vfork
-
-/* Define if you have the __argz_count function.  */
-#undef HAVE___ARGZ_COUNT
-
-/* Define if you have the __argz_next function.  */
-#undef HAVE___ARGZ_NEXT
+#undef HAVE_ALLOCA_H
 
-/* Define if you have the __argz_stringify function.  */
-#undef HAVE___ARGZ_STRINGIFY
+/* Define to 1 if you have the <argz.h> header file. */
+#undef HAVE_ARGZ_H
 
-/* Define if you have the atoll function.  */
+/* Define to 1 if you have the `atoll' function. */
 #undef HAVE_ATOLL
 
-/* Define if you have the atoq function.  */
+/* Define to 1 if you have the `atoq' function. */
 #undef HAVE_ATOQ
 
-/* Define if you have the bcmp function.  */
+/* Define to 1 if you have the `bcmp' function. */
 #undef HAVE_BCMP
 
-/* Define if you have the bcopy function.  */
+/* Define to 1 if you have the `bcopy' function. */
 #undef HAVE_BCOPY
 
-/* Define if you have the bsearch function.  */
+/* Define to 1 if you have the `bsearch' function. */
 #undef HAVE_BSEARCH
 
-/* Define if you have the bzero function.  */
+/* Define to 1 if you have the `bzero' function. */
 #undef HAVE_BZERO
 
-/* Define if you have the dcgettext function.  */
+/* Define to 1 if you have the `dcgettext' function. */
 #undef HAVE_DCGETTEXT
 
-/* Define if you have the fputc_unlocked function.  */
+/* Define to 1 if you have the declaration of `sys_siglist', and to 0 if you
+   don't. */
+#undef HAVE_DECL_SYS_SIGLIST
+
+/* Define to 1 if you have the <direct.h> header file. */
+#undef HAVE_DIRECT_H
+
+/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
+#undef HAVE_DOPRNT
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if you have the `fork' function. */
+#undef HAVE_FORK
+
+/* Define to 1 if you have the `fputc_unlocked' function. */
 #undef HAVE_FPUTC_UNLOCKED
 
-/* Define if you have the fputs_unlocked function.  */
+/* Define to 1 if you have the `fputs_unlocked' function. */
 #undef HAVE_FPUTS_UNLOCKED
 
-/* Define if you have the getcwd function.  */
+/* Define to 1 if you have the `getcwd' function. */
 #undef HAVE_GETCWD
 
-/* Define if you have the getpagesize function.  */
+/* Define to 1 if you have the `getpagesize' function. */
 #undef HAVE_GETPAGESIZE
 
-/* Define if you have the getrlimit function.  */
+/* Define to 1 if you have the `getrlimit' function. */
 #undef HAVE_GETRLIMIT
 
-/* Define if you have the gettimeofday function.  */
+/* Define to 1 if you have the `gettimeofday' function. */
 #undef HAVE_GETTIMEOFDAY
 
-/* Define if you have the index function.  */
+/* Define to 1 if you have the `index' function. */
 #undef HAVE_INDEX
 
-/* Define if you have the isascii function.  */
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `isascii' function. */
 #undef HAVE_ISASCII
 
-/* Define if you have the kill function.  */
+/* Define to 1 if you have the `kill' function. */
 #undef HAVE_KILL
 
-/* Define if you have the munmap function.  */
+/* Define to 1 if you have the `i' library (-li). */
+#undef HAVE_LIBI
+
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define to 1 if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
+
+/* Define to 1 if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have a working `mmap' system call. */
+#undef HAVE_MMAP
+
+/* Define to 1 if you have the `munmap' function. */
 #undef HAVE_MUNMAP
 
-/* Define if you have the popen function.  */
+/* Define to 1 if you have the <nl_types.h> header file. */
+#undef HAVE_NL_TYPES_H
+
+/* Define to 1 if you have the `popen' function. */
 #undef HAVE_POPEN
 
-/* Define if you have the putc_unlocked function.  */
+/* Define to 1 if you have the `putc_unlocked' function. */
 #undef HAVE_PUTC_UNLOCKED
 
-/* Define if you have the putenv function.  */
+/* Define to 1 if you have the `putenv' function. */
 #undef HAVE_PUTENV
 
-/* Define if you have the rindex function.  */
+/* Define to 1 if you have the `rindex' function. */
 #undef HAVE_RINDEX
 
-/* Define if you have the setenv function.  */
+/* Define to 1 if you have the `setenv' function. */
 #undef HAVE_SETENV
 
-/* Define if you have the setlocale function.  */
+/* Define to 1 if you have the `setlocale' function. */
 #undef HAVE_SETLOCALE
 
-/* Define if you have the setrlimit function.  */
+/* Define to 1 if you have the `setrlimit' function. */
 #undef HAVE_SETRLIMIT
 
-/* Define if you have the stpcpy function.  */
+/* Define to 1 if you have the <stab.h> header file. */
+#undef HAVE_STAB_H
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#undef HAVE_STDDEF_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `stpcpy' function. */
 #undef HAVE_STPCPY
 
-/* Define if you have the strcasecmp function.  */
+/* Define to 1 if you have the `strcasecmp' function. */
 #undef HAVE_STRCASECMP
 
-/* Define if you have the strchr function.  */
+/* Define to 1 if you have the `strchr' function. */
 #undef HAVE_STRCHR
 
-/* Define if you have the strdup function.  */
+/* Define to 1 if you have the `strdup' function. */
 #undef HAVE_STRDUP
 
-/* Define if you have the strerror function.  */
+/* Define to 1 if you have the `strerror' function. */
 #undef HAVE_STRERROR
 
-/* Define if you have the strrchr function.  */
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strrchr' function. */
 #undef HAVE_STRRCHR
 
-/* Define if you have the strsignal function.  */
+/* Define to 1 if you have the `strsignal' function. */
 #undef HAVE_STRSIGNAL
 
-/* Define if you have the strtoul function.  */
+/* Define to 1 if you have the `strtoul' function. */
 #undef HAVE_STRTOUL
 
-/* Define if you have the sysconf function.  */
+/* Define to 1 if you have the `sysconf' function. */
 #undef HAVE_SYSCONF
 
-/* Define if you have the <argz.h> header file.  */
-#undef HAVE_ARGZ_H
+/* Define to 1 if you have the <sys/file.h> header file. */
+#undef HAVE_SYS_FILE_H
 
-/* Define if you have the <direct.h> header file.  */
-#undef HAVE_DIRECT_H
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
 
-/* Define if you have the <fcntl.h> header file.  */
-#undef HAVE_FCNTL_H
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#undef HAVE_SYS_RESOURCE_H
 
-/* Define if you have the <limits.h> header file.  */
-#undef HAVE_LIMITS_H
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
 
-/* Define if you have the <locale.h> header file.  */
-#undef HAVE_LOCALE_H
+/* Define to 1 if you have the <sys/times.h> header file. */
+#undef HAVE_SYS_TIMES_H
 
-/* Define if you have the <malloc.h> header file.  */
-#undef HAVE_MALLOC_H
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
 
-/* Define if you have the <nl_types.h> header file.  */
-#undef HAVE_NL_TYPES_H
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
 
-/* Define if you have the <stab.h> header file.  */
-#undef HAVE_STAB_H
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+#undef HAVE_SYS_WAIT_H
 
-/* Define if you have the <stddef.h> header file.  */
-#undef HAVE_STDDEF_H
+/* Define to 1 if you have the <time.h> header file. */
+#undef HAVE_TIME_H
 
-/* Define if you have the <stdlib.h> header file.  */
-#undef HAVE_STDLIB_H
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
 
-/* Define if you have the <string.h> header file.  */
-#undef HAVE_STRING_H
+/* Define to 1 if you have the `vfork' function. */
+#undef HAVE_VFORK
 
-/* Define if you have the <strings.h> header file.  */
-#undef HAVE_STRINGS_H
+/* Define to 1 if you have the <vfork.h> header file. */
+#undef HAVE_VFORK_H
 
-/* Define if you have the <sys/file.h> header file.  */
-#undef HAVE_SYS_FILE_H
+/* Define to 1 if you have the `vprintf' function. */
+#undef HAVE_VPRINTF
 
-/* Define if you have the <sys/param.h> header file.  */
-#undef HAVE_SYS_PARAM_H
+/* Define to 1 if `fork' works. */
+#undef HAVE_WORKING_FORK
 
-/* Define if you have the <sys/resource.h> header file.  */
-#undef HAVE_SYS_RESOURCE_H
+/* Define to 1 if `vfork' works. */
+#undef HAVE_WORKING_VFORK
 
-/* Define if you have the <sys/stat.h> header file.  */
-#undef HAVE_SYS_STAT_H
+/* Define to 1 if you have the `__argz_count' function. */
+#undef HAVE___ARGZ_COUNT
 
-/* Define if you have the <sys/time.h> header file.  */
-#undef HAVE_SYS_TIME_H
+/* Define to 1 if you have the `__argz_next' function. */
+#undef HAVE___ARGZ_NEXT
 
-/* Define if you have the <sys/times.h> header file.  */
-#undef HAVE_SYS_TIMES_H
+/* Define to 1 if you have the `__argz_stringify' function. */
+#undef HAVE___ARGZ_STRINGIFY
 
-/* Define if you have the <time.h> header file.  */
-#undef HAVE_TIME_H
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
 
-/* Define if you have the <unistd.h> header file.  */
-#undef HAVE_UNISTD_H
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
 
-/* Define if you have the i library (-li).  */
-#undef HAVE_LIBI
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* If using the C implementation of alloca, define if you know the
+   direction of stack growth for your system; otherwise it will be
+   automatically deduced at run-time.
+        STACK_DIRECTION > 0 => grows toward higher addresses
+        STACK_DIRECTION < 0 => grows toward lower addresses
+        STACK_DIRECTION = 0 => direction of growth unknown */
+#undef STACK_DIRECTION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
+   `char[]'. */
+#undef YYTEXT_POINTER
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define as `__inline' if that's what the C compiler calls it, or to nothing
+   if it is not supported. */
+#undef inline
+
+/* Define to `long' if <sys/types.h> does not define. */
+#undef off_t
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef pid_t
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+#undef size_t
+
+/* Define as `fork' if `vfork' does not work. */
+#undef vfork
diff -urNEBb gcc-2.95.3-orig/gcc/config.in~ gcc-2.95.3/gcc/config.in~
--- gcc-2.95.3-orig/gcc/config.in~	1970-01-01 01:00:00.000000000 +0100
+++ gcc-2.95.3/gcc/config.in~	2003-12-02 17:50:55.000000000 +0100
@@ -0,0 +1,396 @@
+/* config.in.  Generated automatically from configure.in by autoheader.  */
+/* Define if you can safely include both <string.h> and <strings.h>.  */
+#undef STRING_WITH_STRINGS
+
+/* Define if printf supports "%p".  */
+#undef HAVE_PRINTF_PTR
+
+/* Define if you want expensive run-time checks. */
+#undef ENABLE_CHECKING
+
+/* Define to 1 if NLS is requested.  */
+#undef ENABLE_NLS
+
+/* Define as 1 if you have catgets and don't want to use GNU gettext.  */
+#undef HAVE_CATGETS
+
+/* Define as 1 if you have gettext and don't want to use GNU gettext.  */
+#undef HAVE_GETTEXT
+
+/* Define if your cpp understands the stringify operator.  */
+#undef HAVE_CPP_STRINGIFY
+
+/* Define if your compiler understands volatile.  */
+#undef HAVE_VOLATILE
+
+/* Define if your assembler supports specifying the maximum number
+   of bytes to skip when using the GAS .p2align command. */
+#undef HAVE_GAS_MAX_SKIP_P2ALIGN
+
+/* Define if your assembler supports .balign and .p2align.  */
+#undef HAVE_GAS_BALIGN_AND_P2ALIGN
+
+/* Define if your assembler supports .subsection and .subsection -1 starts
+   emitting at the beginning of your section */
+#undef HAVE_GAS_SUBSECTION_ORDERING
+
+/* Define if your assembler uses the old HImode fild and fist notation.  */
+#undef HAVE_GAS_FILDS_FISTS
+
+/* Define if you have a working <inttypes.h> header file.  */
+#undef HAVE_INTTYPES_H
+
+/* Define if your locale.h file contains LC_MESSAGES.  */
+#undef HAVE_LC_MESSAGES
+
+/* Define as 1 if you have the stpcpy function.  */
+#undef HAVE_STPCPY
+
+/* Whether malloc must be declared even if <stdlib.h> is included.  */
+#undef NEED_DECLARATION_MALLOC
+
+/* Whether realloc must be declared even if <stdlib.h> is included.  */
+#undef NEED_DECLARATION_REALLOC
+
+/* Whether calloc must be declared even if <stdlib.h> is included.  */
+#undef NEED_DECLARATION_CALLOC
+
+/* Whether free must be declared even if <stdlib.h> is included.  */
+#undef NEED_DECLARATION_FREE
+
+/* Whether bcopy must be declared even if <string.h> is included.  */
+#undef NEED_DECLARATION_BCOPY
+
+/* Whether bcmp must be declared even if <string.h> is included.  */
+#undef NEED_DECLARATION_BCMP
+
+/* Whether bzero must be declared even if <string.h> is included.  */
+#undef NEED_DECLARATION_BZERO
+
+/* Whether index must be declared even if <string.h> is included.  */
+#undef NEED_DECLARATION_INDEX
+
+/* Whether rindex must be declared even if <string.h> is included.  */
+#undef NEED_DECLARATION_RINDEX
+
+/* Whether getenv must be declared even if <stdlib.h> is included.  */
+#undef NEED_DECLARATION_GETENV
+
+/* Whether atol must be declared even if <stdlib.h> is included.  */
+#undef NEED_DECLARATION_ATOL
+
+/* Whether atof must be declared even if <stdlib.h> is included.  */
+#undef NEED_DECLARATION_ATOF
+
+/* Whether sbrk must be declared even if <stdlib.h> is included.  */
+#undef NEED_DECLARATION_SBRK
+
+/* Whether abort must be declared even if <stdlib.h> is included.  */
+#undef NEED_DECLARATION_ABORT
+
+/* Whether strerror must be declared even if <string.h> is included.  */
+#undef NEED_DECLARATION_STRERROR
+
+/* Whether strsignal must be declared even if <string.h> is included.  */
+#undef NEED_DECLARATION_STRSIGNAL
+
+/* Whether strstr must be declared even if <string.h> is included.  */
+#undef NEED_DECLARATION_STRSTR
+
+/* Whether getcwd must be declared even if <unistd.h> is included.  */
+#undef NEED_DECLARATION_GETCWD
+
+/* Whether getwd must be declared even if <unistd.h> is included.  */
+#undef NEED_DECLARATION_GETWD
+
+/* Whether getrlimit must be declared even if <sys/resource.h> is included.  */
+#undef NEED_DECLARATION_GETRLIMIT
+
+/* Whether setrlimit must be declared even if <sys/resource.h> is included.  */
+#undef NEED_DECLARATION_SETRLIMIT
+
+/* Whether putc_unlocked must be declared even if <stdio.h> is included.  */
+#undef NEED_DECLARATION_PUTC_UNLOCKED
+
+/* Whether fputs_unlocked must be declared even if <stdio.h> is included.  */
+#undef NEED_DECLARATION_FPUTS_UNLOCKED
+
+/* Define to enable the use of a default assembler. */
+#undef DEFAULT_ASSEMBLER
+
+/* Define to enable the use of a default linker. */
+#undef DEFAULT_LINKER
+
+/* Define if host mkdir takes a single argument. */
+#undef MKDIR_TAKES_ONE_ARG
+
+/* Define to the name of the distribution.  */
+#undef PACKAGE
+
+/* Define to the version of the distribution.  */
+#undef VERSION
+
+
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+   systems. This function is required for `alloca.c' support on those systems.
+   */
+#undef CRAY_STACKSEG_END
+
+/* Define if using `alloca.c'. */
+#undef C_ALLOCA
+
+/* Define if you have `alloca', as a function or macro. */
+#undef HAVE_ALLOCA
+
+/* Define if you have <alloca.h> and it should be used (not on Ultrix).  */
+#undef HAVE_ALLOCA_H
+
+/* Define if you have the <argz.h> header file. */
+#undef HAVE_ARGZ_H
+
+/* Define if you have the `atoll' function. */
+#undef HAVE_ATOLL
+
+/* Define if you have the `atoq' function. */
+#undef HAVE_ATOQ
+
+/* Define if you have the `bcmp' function. */
+#undef HAVE_BCMP
+
+/* Define if you have the `bcopy' function. */
+#undef HAVE_BCOPY
+
+/* Define if you have the `bsearch' function. */
+#undef HAVE_BSEARCH
+
+/* Define if you have the `bzero' function. */
+#undef HAVE_BZERO
+
+/* Define if you have the `dcgettext' function. */
+#undef HAVE_DCGETTEXT
+
+/* Define if you have the <direct.h> header file. */
+#undef HAVE_DIRECT_H
+
+/* Define if you don't have `vprintf' but do have `_doprnt.' */
+#undef HAVE_DOPRNT
+
+/* Define if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define if you have the `fork' function. */
+#undef HAVE_FORK
+
+/* Define if you have the `fputc_unlocked' function. */
+#undef HAVE_FPUTC_UNLOCKED
+
+/* Define if you have the `fputs_unlocked' function. */
+#undef HAVE_FPUTS_UNLOCKED
+
+/* Define if you have the `getcwd' function. */
+#undef HAVE_GETCWD
+
+/* Define if you have the `getpagesize' function. */
+#undef HAVE_GETPAGESIZE
+
+/* Define if you have the `getrlimit' function. */
+#undef HAVE_GETRLIMIT
+
+/* Define if you have the `gettimeofday' function. */
+#undef HAVE_GETTIMEOFDAY
+
+/* Define if you have the `index' function. */
+#undef HAVE_INDEX
+
+/* Define if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define if you have the `isascii' function. */
+#undef HAVE_ISASCII
+
+/* Define if you have the `kill' function. */
+#undef HAVE_KILL
+
+/* Define if you have the `i' library (-li). */
+#undef HAVE_LIBI
+
+/* Define if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
+
+/* Define if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
+
+/* Define if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define if you have a working `mmap' system call. */
+#undef HAVE_MMAP
+
+/* Define if you have the `munmap' function. */
+#undef HAVE_MUNMAP
+
+/* Define if you have the <nl_types.h> header file. */
+#undef HAVE_NL_TYPES_H
+
+/* Define if you have the `popen' function. */
+#undef HAVE_POPEN
+
+/* Define if you have the `putc_unlocked' function. */
+#undef HAVE_PUTC_UNLOCKED
+
+/* Define if you have the `putenv' function. */
+#undef HAVE_PUTENV
+
+/* Define if you have the `rindex' function. */
+#undef HAVE_RINDEX
+
+/* Define if you have the `setenv' function. */
+#undef HAVE_SETENV
+
+/* Define if you have the `setlocale' function. */
+#undef HAVE_SETLOCALE
+
+/* Define if you have the `setrlimit' function. */
+#undef HAVE_SETRLIMIT
+
+/* Define if you have the <stab.h> header file. */
+#undef HAVE_STAB_H
+
+/* Define if you have the <stddef.h> header file. */
+#undef HAVE_STDDEF_H
+
+/* Define if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define if you have the `stpcpy' function. */
+#undef HAVE_STPCPY
+
+/* Define if you have the `strcasecmp' function. */
+#undef HAVE_STRCASECMP
+
+/* Define if you have the `strchr' function. */
+#undef HAVE_STRCHR
+
+/* Define if you have the `strdup' function. */
+#undef HAVE_STRDUP
+
+/* Define if you have the `strerror' function. */
+#undef HAVE_STRERROR
+
+/* Define if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define if you have the `strrchr' function. */
+#undef HAVE_STRRCHR
+
+/* Define if you have the `strsignal' function. */
+#undef HAVE_STRSIGNAL
+
+/* Define if you have the `strtoul' function. */
+#undef HAVE_STRTOUL
+
+/* Define if you have the `sysconf' function. */
+#undef HAVE_SYSCONF
+
+/* Define if you have the <sys/file.h> header file.  */
+#undef HAVE_SYS_FILE_H
+
+/* Define if you have the <sys/param.h> header file.  */
+#undef HAVE_SYS_PARAM_H
+
+/* Define if you have the <sys/resource.h> header file.  */
+#undef HAVE_SYS_RESOURCE_H
+
+/* Define if you have the <sys/stat.h> header file.  */
+#undef HAVE_SYS_STAT_H
+
+/* Define if you have the <sys/times.h> header file. */
+#undef HAVE_SYS_TIMES_H
+
+/* Define if you have the <sys/time.h> header file.  */
+#undef HAVE_SYS_TIME_H
+
+/* Define if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
+#undef HAVE_SYS_WAIT_H
+
+/* Define if you have the <time.h> header file.  */
+#undef HAVE_TIME_H
+
+/* Define if you have the <unistd.h> header file.  */
+#undef HAVE_UNISTD_H
+
+/* Define if you have the `vfork' function. */
+#undef HAVE_VFORK
+
+/* Define if you have the <vfork.h> header file. */
+#undef HAVE_VFORK_H
+
+/* Define if you have the `vprintf' function. */
+#undef HAVE_VPRINTF
+
+/* Define if `fork' works. */
+#undef HAVE_WORKING_FORK
+
+/* Define if `vfork' works. */
+#undef HAVE_WORKING_VFORK
+
+/* Define if you have the `__argz_count' function. */
+#undef HAVE___ARGZ_COUNT
+
+/* Define if you have the `__argz_next' function. */
+#undef HAVE___ARGZ_NEXT
+
+/* Define if you have the `__argz_stringify' function. */
+#undef HAVE___ARGZ_STRINGIFY
+
+/* If using the C implementation of alloca, define if you know the
+   direction of stack growth for your system; otherwise it will be
+   automatically deduced at run-time.
+        STACK_DIRECTION > 0 => grows toward higher addresses
+        STACK_DIRECTION < 0 => grows toward lower addresses
+        STACK_DIRECTION = 0 => direction of growth unknown */
+#undef STACK_DIRECTION
+
+/* Define if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define if `sys_siglist' is declared by <signal.h> or <unistd.h>. */
+#undef SYS_SIGLIST_DECLARED
+
+/* Define if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Define if `lex' declares `yytext' as a `char *' by default, not a `char[]'.
+   */
+#undef YYTEXT_POINTER
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define as `__inline' if that's what the C compiler calls it, or to nothing
+   if it is not supported. */
+#undef inline
+
+/* Define to `long' if <sys/types.h> does not define. */
+#undef off_t
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef pid_t
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+#undef size_t
+
+/* Define as `fork' if `vfork' does not work. */
+#undef vfork
diff -urNEBb gcc-2.95.3-orig/gcc/configure gcc-2.95.3/gcc/configure
--- gcc-2.95.3-orig/gcc/configure	2001-03-16 15:13:48.000000000 +0100
+++ gcc-2.95.3/gcc/configure	2003-12-02 17:50:54.000000000 +0100
@@ -1,85 +1,324 @@
 #! /bin/sh
-
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.13 
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+# Generated by GNU Autoconf 2.57.
 #
+# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)$' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+	 case $as_dir in
+	 /*)
+	   if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+	     CONFIG_SHELL=$as_dir/$as_base
+	     export CONFIG_SHELL
+	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+	   fi;;
+	 esac
+       done
+done
+;;
+  esac
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+
 
-# Defaults:
-ac_help=
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
 ac_default_prefix=/usr/local
-# Any additions from configure.in:
-ac_help="$ac_help
-  --with-gnu-ld           arrange to work with GNU ld."
-ac_help="$ac_help
-  --with-ld               arrange to use the specified ld (full pathname)."
-ac_help="$ac_help
-  --with-gnu-as           arrange to work with GNU as."
-ac_help="$ac_help
-  --with-as               arrange to use the specified as (full pathname)."
-ac_help="$ac_help
-  --with-stabs            arrange to use stabs instead of host debug format."
-ac_help="$ac_help
-  --with-elf              arrange to use ELF instead of host debug format."
-ac_help="$ac_help
-  --with-local-prefix=DIR specifies directory to put local include."
-ac_help="$ac_help
-  --with-gxx-include-dir=DIR
-                          specifies directory to put g++ header files."
-ac_help="$ac_help
-  --enable-checking       enable expensive run-time checks."
-ac_help="$ac_help
-  --disable-cpp           don't provide a user-visible C preprocessor."
-ac_help="$ac_help
-  --with-cpp-install-dir=DIR
-                          install the user visible C preprocessor in DIR
-                          (relative to PREFIX) as well as PREFIX/bin."
-ac_help="$ac_help
-  --enable-cpplib         use cpplib for the C preprocessor."
-ac_help="$ac_help
-  --enable-c-cpplib       link cpplib directly into C and C++ compilers
-                          (EXPERIMENTAL) (implies --enable-cpplib)."
-ac_help="$ac_help
-  --enable-c-mbchar       enable multibyte characters for C and C++."
-ac_help="$ac_help
-  --disable-fast-fixincludes
-                         Disable the new fast fixincludes.
-                         Run the old fixincludes script unconditionally"
-ac_help="$ac_help
-  --enable-haifa          use the experimental scheduler.
-  --disable-haifa         don't use the experimental scheduler for the
-                          targets which normally enable it."
-ac_help="$ac_help
-  --enable-threads        enable thread usage for target GCC.
-  --enable-threads=LIB    use LIB thread package for target GCC."
-ac_help="$ac_help
-  --enable-objc-gc	  enable the use of Boehm's garbage collector with
-			  the GNU Objective-C runtime."
-ac_help="$ac_help
-  --enable-java-gc=TYPE   choose garbage collector [boehm]"
-ac_help="$ac_help
-  --enable-dwarf2	  enable DWARF2 debugging as default."
-ac_help="$ac_help
-  --enable-nls            use Native Language Support (disabled by default).
-                          EXPERIMENTAL, see ABOUT-GCC-NLS."
-ac_help="$ac_help
-  --disable-nls           do not use Native Language Support"
-ac_help="$ac_help
-  --with-included-gettext use the GNU gettext library included here"
-ac_help="$ac_help
-  --with-catgets          use catgets functions if available"
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete.  It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_unique_file="tree.c"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+#  include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT stage1_warn_cflags SET_MAKE AWK LEX LEXLIB LEX_OUTPUT_ROOT LN LN_S RANLIB ac_ct_RANLIB YACC INSTALL INSTALL_PROGRAM INSTALL_DATA CPP EGREP gnat vfprintf doprint manext objext PACKAGE VERSION ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT GENCAT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l gthread_flags build_canonical host_canonical target_subdir inhibit_libc sched_prefix sched_cflags gcc_tooldir dollar objdir subdirs all_boot_languages all_compilers all_diff_excludes all_headers all_lang_makefiles all_languages all_lib2funcs all_stagestuff build_exeext build_install_headers_dir build_xm_file_list cc_set_by_configure quoted_cc_set_by_configure cpp_install_dir cpp_main dep_host_xmake_file dep_tmake_file extra_c_flags extra_c_objs extra_cpp_objs extra_cxx_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs fixinc_defs float_h_file gcc_gxx_include_dir gcc_version gcc_version_trigger host_exeext host_extra_gcc_objs host_xm_file_list install JAVAGC lang_options_files lang_specs_files lang_tree_files local_prefix maybe_use_collect2 md_file objc_boehm_gc out_file out_object_file stage_prefix_set_by_configure symbolic_link thread_file tm_file_list will_use_collect2 cross_defines LIBOBJS LTLIBOBJS'
+ac_subst_files='target_overrides host_overrides cross_overrides build_overrides language_fragments language_hooks'
 
 # Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
 # The variables have the same names as the options, with
 # dashes changed to underlines.
-build=NONE
-cache_file=./config.cache
+cache_file=/dev/null
 exec_prefix=NONE
-host=NONE
 no_create=
-nonopt=NONE
 no_recursion=
 prefix=NONE
 program_prefix=NONE
@@ -88,10 +327,15 @@
 silent=
 site=
 srcdir=
-target=NONE
 verbose=
 x_includes=NONE
 x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
 bindir='${exec_prefix}/bin'
 sbindir='${exec_prefix}/sbin'
 libexecdir='${exec_prefix}/libexec'
@@ -105,13 +349,6 @@
 infodir='${prefix}/info'
 mandir='${prefix}/man'
 
-# Initialize some other variables.
-subdirs=
-MFLAGS= MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-# Maximum number of lines to put in a shell here document.
-ac_max_here_lines=12
-
 ac_prev=
 for ac_option
 do
@@ -123,59 +360,59 @@
     continue
   fi
 
-  case "$ac_option" in
-  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
-  *) ac_optarg= ;;
-  esac
+  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
 
   # Accept the important Cygnus configure options, so we can diagnose typos.
 
-  case "$ac_option" in
+  case $ac_option in
 
   -bindir | --bindir | --bindi | --bind | --bin | --bi)
     ac_prev=bindir ;;
   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
-    bindir="$ac_optarg" ;;
+    bindir=$ac_optarg ;;
 
   -build | --build | --buil | --bui | --bu)
-    ac_prev=build ;;
+    ac_prev=build_alias ;;
   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
-    build="$ac_optarg" ;;
+    build_alias=$ac_optarg ;;
 
   -cache-file | --cache-file | --cache-fil | --cache-fi \
   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
     ac_prev=cache_file ;;
   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
-    cache_file="$ac_optarg" ;;
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
 
   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
     ac_prev=datadir ;;
   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
   | --da=*)
-    datadir="$ac_optarg" ;;
+    datadir=$ac_optarg ;;
 
   -disable-* | --disable-*)
-    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
-      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
-    fi
-    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
-    eval "enable_${ac_feature}=no" ;;
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    eval "enable_$ac_feature=no" ;;
 
   -enable-* | --enable-*)
-    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
-      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
-    fi
-    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
-    case "$ac_option" in
-      *=*) ;;
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
       *) ac_optarg=yes ;;
     esac
-    eval "enable_${ac_feature}='$ac_optarg'" ;;
+    eval "enable_$ac_feature='$ac_optarg'" ;;
 
   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -184,95 +421,47 @@
   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
   | --exec=* | --exe=* | --ex=*)
-    exec_prefix="$ac_optarg" ;;
+    exec_prefix=$ac_optarg ;;
 
   -gas | --gas | --ga | --g)
     # Obsolete; use --with-gas.
     with_gas=yes ;;
 
-  -help | --help | --hel | --he)
-    # Omit some internal or obsolete options to make the list less imposing.
-    # This message is too long to be a string in the A/UX 3.1 sh.
-    cat << EOF
-Usage: configure [options] [host]
-Options: [defaults in brackets after descriptions]
-Configuration:
-  --cache-file=FILE       cache test results in FILE
-  --help                  print this message
-  --no-create             do not create output files
-  --quiet, --silent       do not print \`checking...' messages
-  --version               print the version of autoconf that created configure
-Directory and file names:
-  --prefix=PREFIX         install architecture-independent files in PREFIX
-                          [$ac_default_prefix]
-  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-                          [same as prefix]
-  --bindir=DIR            user executables in DIR [EPREFIX/bin]
-  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
-  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
-  --datadir=DIR           read-only architecture-independent data in DIR
-                          [PREFIX/share]
-  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
-  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
-                          [PREFIX/com]
-  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
-  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
-  --includedir=DIR        C header files in DIR [PREFIX/include]
-  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
-  --infodir=DIR           info documentation in DIR [PREFIX/info]
-  --mandir=DIR            man documentation in DIR [PREFIX/man]
-  --srcdir=DIR            find the sources in DIR [configure dir or ..]
-  --program-prefix=PREFIX prepend PREFIX to installed program names
-  --program-suffix=SUFFIX append SUFFIX to installed program names
-  --program-transform-name=PROGRAM
-                          run sed PROGRAM on installed program names
-EOF
-    cat << EOF
-Host type:
-  --build=BUILD           configure for building on BUILD [BUILD=HOST]
-  --host=HOST             configure for HOST [guessed]
-  --target=TARGET         configure for TARGET [TARGET=HOST]
-Features and packages:
-  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
-  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
-  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --x-includes=DIR        X include files are in DIR
-  --x-libraries=DIR       X library files are in DIR
-EOF
-    if test -n "$ac_help"; then
-      echo "--enable and --with options recognized:$ac_help"
-    fi
-    exit 0 ;;
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
 
   -host | --host | --hos | --ho)
-    ac_prev=host ;;
+    ac_prev=host_alias ;;
   -host=* | --host=* | --hos=* | --ho=*)
-    host="$ac_optarg" ;;
+    host_alias=$ac_optarg ;;
 
   -includedir | --includedir | --includedi | --included | --include \
   | --includ | --inclu | --incl | --inc)
     ac_prev=includedir ;;
   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
   | --includ=* | --inclu=* | --incl=* | --inc=*)
-    includedir="$ac_optarg" ;;
+    includedir=$ac_optarg ;;
 
   -infodir | --infodir | --infodi | --infod | --info | --inf)
     ac_prev=infodir ;;
   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
-    infodir="$ac_optarg" ;;
+    infodir=$ac_optarg ;;
 
   -libdir | --libdir | --libdi | --libd)
     ac_prev=libdir ;;
   -libdir=* | --libdir=* | --libdi=* | --libd=*)
-    libdir="$ac_optarg" ;;
+    libdir=$ac_optarg ;;
 
   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
   | --libexe | --libex | --libe)
     ac_prev=libexecdir ;;
   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
   | --libexe=* | --libex=* | --libe=*)
-    libexecdir="$ac_optarg" ;;
+    libexecdir=$ac_optarg ;;
 
   -localstatedir | --localstatedir | --localstatedi | --localstated \
   | --localstate | --localstat | --localsta | --localst \
@@ -281,19 +470,19 @@
   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
-    localstatedir="$ac_optarg" ;;
+    localstatedir=$ac_optarg ;;
 
   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
     ac_prev=mandir ;;
   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
-    mandir="$ac_optarg" ;;
+    mandir=$ac_optarg ;;
 
   -nfp | --nfp | --nf)
     # Obsolete; use --without-fp.
     with_fp=no ;;
 
   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
-  | --no-cr | --no-c)
+  | --no-cr | --no-c | -n)
     no_create=yes ;;
 
   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
@@ -307,26 +496,26 @@
   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
-    oldincludedir="$ac_optarg" ;;
+    oldincludedir=$ac_optarg ;;
 
   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
     ac_prev=prefix ;;
   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
-    prefix="$ac_optarg" ;;
+    prefix=$ac_optarg ;;
 
   -program-prefix | --program-prefix | --program-prefi | --program-pref \
   | --program-pre | --program-pr | --program-p)
     ac_prev=program_prefix ;;
   -program-prefix=* | --program-prefix=* | --program-prefi=* \
   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
-    program_prefix="$ac_optarg" ;;
+    program_prefix=$ac_optarg ;;
 
   -program-suffix | --program-suffix | --program-suffi | --program-suff \
   | --program-suf | --program-su | --program-s)
     ac_prev=program_suffix ;;
   -program-suffix=* | --program-suffix=* | --program-suffi=* \
   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
-    program_suffix="$ac_optarg" ;;
+    program_suffix=$ac_optarg ;;
 
   -program-transform-name | --program-transform-name \
   | --program-transform-nam | --program-transform-na \
@@ -343,7 +532,7 @@
   | --program-transfo=* | --program-transf=* \
   | --program-trans=* | --program-tran=* \
   | --progr-tra=* | --program-tr=* | --program-t=*)
-    program_transform_name="$ac_optarg" ;;
+    program_transform_name=$ac_optarg ;;
 
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil)
@@ -353,7 +542,7 @@
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
   | --sbi=* | --sb=*)
-    sbindir="$ac_optarg" ;;
+    sbindir=$ac_optarg ;;
 
   -sharedstatedir | --sharedstatedir | --sharedstatedi \
   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
@@ -364,58 +553,57 @@
   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
   | --sha=* | --sh=*)
-    sharedstatedir="$ac_optarg" ;;
+    sharedstatedir=$ac_optarg ;;
 
   -site | --site | --sit)
     ac_prev=site ;;
   -site=* | --site=* | --sit=*)
-    site="$ac_optarg" ;;
+    site=$ac_optarg ;;
 
   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
     ac_prev=srcdir ;;
   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
-    srcdir="$ac_optarg" ;;
+    srcdir=$ac_optarg ;;
 
   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
   | --syscon | --sysco | --sysc | --sys | --sy)
     ac_prev=sysconfdir ;;
   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
-    sysconfdir="$ac_optarg" ;;
+    sysconfdir=$ac_optarg ;;
 
   -target | --target | --targe | --targ | --tar | --ta | --t)
-    ac_prev=target ;;
+    ac_prev=target_alias ;;
   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
-    target="$ac_optarg" ;;
+    target_alias=$ac_optarg ;;
 
   -v | -verbose | --verbose | --verbos | --verbo | --verb)
     verbose=yes ;;
 
-  -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.13"
-    exit 0 ;;
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
 
   -with-* | --with-*)
-    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
-      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
-    fi
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
     ac_package=`echo $ac_package| sed 's/-/_/g'`
-    case "$ac_option" in
-      *=*) ;;
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
       *) ac_optarg=yes ;;
     esac
-    eval "with_${ac_package}='$ac_optarg'" ;;
+    eval "with_$ac_package='$ac_optarg'" ;;
 
   -without-* | --without-*)
-    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
-      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
-    fi
-    ac_package=`echo $ac_package| sed 's/-/_/g'`
-    eval "with_${ac_package}=no" ;;
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/-/_/g'`
+    eval "with_$ac_package=no" ;;
 
   --x)
     # Obsolete; use --with-x.
@@ -426,99 +614,110 @@
     ac_prev=x_includes ;;
   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
-    x_includes="$ac_optarg" ;;
+    x_includes=$ac_optarg ;;
 
   -x-libraries | --x-libraries | --x-librarie | --x-librari \
   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
     ac_prev=x_libraries ;;
   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
-    x_libraries="$ac_optarg" ;;
+    x_libraries=$ac_optarg ;;
 
-  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+  -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
     ;;
 
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+    eval "$ac_envvar='$ac_optarg'"
+    export $ac_envvar ;;
+
   *)
-    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
-      echo "configure: warning: $ac_option: invalid host type" 1>&2
-    fi
-    if test "x$nonopt" != xNONE; then
-      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
-    fi
-    nonopt="$ac_option"
+    # FIXME: should be removed in autoconf 3.0.
+    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
     ;;
 
   esac
 done
 
 if test -n "$ac_prev"; then
-  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
-fi
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-# File descriptor usage:
-# 0 standard input
-# 1 file creation
-# 2 errors and warnings
-# 3 some systems may open it to /dev/tty
-# 4 used on the Kubota Titan
-# 6 checking for... messages and results
-# 5 compiler messages saved in config.log
-if test "$silent" = yes; then
-  exec 6>/dev/null
-else
-  exec 6>&1
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
 fi
-exec 5>./config.log
 
-echo "\
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-" 1>&5
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
 
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Also quote any args containing shell metacharacters.
-ac_configure_args=
-for ac_arg
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+              localstatedir libdir includedir oldincludedir infodir mandir
 do
-  case "$ac_arg" in
-  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
-  | --no-cr | --no-c) ;;
-  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
-  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
-  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
-  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
-  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
   esac
 done
 
-# NLS nuisances.
-# Only set these to C if already set.  These must not be set unconditionally
-# because not all systems understand e.g. LANG=C (notably SCO).
-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
-# Non-C LC_CTYPE values break the ctype check.
-if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
-if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
 
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo > confdefs.h
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
 
-# A filename unique to this package, relative to the directory that
-# configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=tree.c
 
 # Find the source files, if location was not specified.
 if test -z "$srcdir"; then
   ac_srcdir_defaulted=yes
   # Try the directory containing this script, then its parent.
-  ac_prog=$0
-  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
-  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+  ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+         X"$0" : 'X\(//\)[^/]' \| \
+         X"$0" : 'X\(//\)$' \| \
+         X"$0" : 'X\(/\)' \| \
+         .     : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
   srcdir=$ac_confdir
   if test ! -r $srcdir/$ac_unique_file; then
     srcdir=..
@@ -528,13 +727,470 @@
 fi
 if test ! -r $srcdir/$ac_unique_file; then
   if test "$ac_srcdir_defaulted" = yes; then
-    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+   { (exit 1); exit 1; }; }
+  else
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+  fi
+fi
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+   { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+  cat <<_ACEOF
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR           user executables [EPREFIX/bin]
+  --sbindir=DIR          system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR       program executables [EPREFIX/libexec]
+  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
+  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
+  --libdir=DIR           object code libraries [EPREFIX/lib]
+  --includedir=DIR       C header files [PREFIX/include]
+  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
+  --infodir=DIR          info documentation [PREFIX/info]
+  --mandir=DIR           man documentation [PREFIX/man]
+_ACEOF
+
+  cat <<\_ACEOF
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+  --target=TARGET   configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --enable-checking       enable expensive run-time checks.
+  --disable-cpp           don't provide a user-visible C preprocessor.
+  --enable-cpplib         use cpplib for the C preprocessor.
+  --enable-c-cpplib       link cpplib directly into C and C++ compilers
+                          (EXPERIMENTAL) (implies --enable-cpplib).
+  --enable-c-mbchar       enable multibyte characters for C and C++.
+  --disable-fast-fixincludes
+                         Disable the new fast fixincludes.
+                         Run the old fixincludes script unconditionally
+  --enable-haifa          use the experimental scheduler.
+  --disable-haifa         don't use the experimental scheduler for the
+                          targets which normally enable it.
+  --enable-threads        enable thread usage for target GCC.
+  --enable-threads=LIB    use LIB thread package for target GCC.
+  --enable-objc-gc	  enable the use of Boehm's garbage collector with
+			  the GNU Objective-C runtime.
+  --enable-java-gc=TYPE   choose garbage collector boehm
+  --enable-nls            use Native Language Support (disabled by default).
+                          EXPERIMENTAL, see ABOUT-GCC-NLS.
+  --disable-nls           do not use Native Language Support
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-gnu-ld           arrange to work with GNU ld.
+  --with-ld               arrange to use the specified ld (full pathname).
+  --with-gnu-as           arrange to work with GNU as.
+  --with-as               arrange to use the specified as (full pathname).
+  --with-stabs            arrange to use stabs instead of host debug format.
+  --with-elf              arrange to use ELF instead of host debug format.
+  --with-local-prefix=DIR specifies directory to put local include.
+  --with-gxx-include-dir=DIR
+                          specifies directory to put g++ header files.
+  --with-cpp-install-dir=DIR
+                          install the user visible C preprocessor in DIR
+                          (relative to PREFIX) as well as PREFIX/bin.
+  --enable-dwarf2	  enable DWARF2 debugging as default.
+  --with-included-gettext use the GNU gettext library included here
+  --with-catgets          use catgets functions if available
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
+              headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  ac_popdir=`pwd`
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d $ac_dir || continue
+    ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+    cd $ac_dir
+    # Check for guested configure; otherwise get Cygnus style configure.
+    if test -f $ac_srcdir/configure.gnu; then
+      echo
+      $SHELL $ac_srcdir/configure.gnu  --help=recursive
+    elif test -f $ac_srcdir/configure; then
+      echo
+      $SHELL $ac_srcdir/configure  --help=recursive
+    elif test -f $ac_srcdir/configure.ac ||
+           test -f $ac_srcdir/configure.in; then
+      echo
+      $ac_configure --help
   else
-    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
   fi
+    cd $ac_popdir
+  done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+  cat <<\_ACEOF
+
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit 0
 fi
-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by $as_me, which was
+generated by GNU Autoconf 2.57.  Invocation command line was
 
+  $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+        ac_must_keep_next=false # Got value, back to normal.
+      else
+        case $ac_arg in
+          *=* | --config-cache | -C | -disable-* | --disable-* \
+          | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+          | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+          | -with-* | --with-* | -without-* | --without-* | --x)
+            case "$ac_configure_args0 " in
+              "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+            esac
+            ;;
+          -* ) ac_must_keep_next=true ;;
+        esac
+      fi
+      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+      # Get rid of the leading space.
+      ac_sep=" "
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+{
+  (set) 2>&1 |
+    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      sed -n \
+        "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+    	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+      ;;
+    *)
+      sed -n \
+        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+}
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=$`echo $ac_var`
+      echo "$ac_var='"'"'$ac_val'"'"'"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=$`echo $ac_var`
+        echo "$ac_var='"'"'$ac_val'"'"'"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      sed "/^$/d" confdefs.h | sort
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core core.* *.core &&
+  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+     ' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
 # Prefer explicitly selected file to automatically selected ones.
 if test -z "$CONFIG_SITE"; then
   if test "x$prefix" != xNONE; then
@@ -545,43 +1201,108 @@
 fi
 for ac_site_file in $CONFIG_SITE; do
   if test -r "$ac_site_file"; then
-    echo "loading site script $ac_site_file"
+    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
     . "$ac_site_file"
   fi
 done
 
 if test -r "$cache_file"; then
-  echo "loading cache $cache_file"
-  . $cache_file
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . $cache_file;;
+      *)                      . ./$cache_file;;
+    esac
+  fi
 else
-  echo "creating cache $cache_file"
-  > $cache_file
+  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+               sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+  eval ac_new_val="\$ac_env_${ac_var}_value"
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+        { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+        { echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
+echo "$as_me:   former value:  $ac_old_val" >&2;}
+        { echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
+echo "$as_me:   current value: $ac_new_val" >&2;}
+        ac_cache_corrupted=:
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
 ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-ac_exeext=
-ac_objext=o
-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
-  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
-  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
-    ac_n= ac_c='
-' ac_t='	'
-  else
-    ac_n=-n ac_c= ac_t=
-  fi
-else
-  ac_n= ac_c='\c' ac_t=
-fi
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+          ac_config_headers="$ac_config_headers auto-host.h:config.in"
+
+
 remove=rm
 hard_link=ln
 symbolic_link='ln -s'
@@ -595,8 +1316,8 @@
 # - one of the terminals (":" and ";") is the first or last sign
 # - two terminals occur directly after each other
 # - the path contains an element with a dot in it
-echo $ac_n "checking LIBRARY_PATH variable""... $ac_c" 1>&6
-echo "configure:600: checking LIBRARY_PATH variable" >&5
+echo "$as_me:$LINENO: checking LIBRARY_PATH variable" >&5
+echo $ECHO_N "checking LIBRARY_PATH variable... $ECHO_C" >&6
 case ${LIBRARY_PATH} in
   [:\;]* | *[:\;] | *[:\;][:\;]* |  *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
     library_path_setting="contains current directory"
@@ -605,12 +1326,18 @@
     library_path_setting="ok"
     ;;
 esac
-echo "$ac_t""$library_path_setting" 1>&6
+echo "$as_me:$LINENO: result: $library_path_setting" >&5
+echo "${ECHO_T}$library_path_setting" >&6
 if test "$library_path_setting" != "ok"; then
-{ echo "configure: error: 
+{ { echo "$as_me:$LINENO: error:
+*** LIBRARY_PATH shouldn't contain the current directory when
+*** building gcc. Please change the environment variable
+*** and run configure again." >&5
+echo "$as_me: error:
 *** LIBRARY_PATH shouldn't contain the current directory when
 *** building gcc. Please change the environment variable
-*** and run configure again." 1>&2; exit 1; }
+*** and run configure again." >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
 # Test if GCC_EXEC_PREFIX contains the notation for the current directory
@@ -620,8 +1347,8 @@
 # - one of the terminals (":" and ";") is the first or last sign
 # - two terminals occur directly after each other
 # - the path contains an element with a dot in it
-echo $ac_n "checking GCC_EXEC_PREFIX variable""... $ac_c" 1>&6
-echo "configure:625: checking GCC_EXEC_PREFIX variable" >&5
+echo "$as_me:$LINENO: checking GCC_EXEC_PREFIX variable" >&5
+echo $ECHO_N "checking GCC_EXEC_PREFIX variable... $ECHO_C" >&6
 case ${GCC_EXEC_PREFIX} in
   [:\;]* | *[:\;] | *[:\;][:\;]* |  *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
     gcc_exec_prefix_setting="contains current directory"
@@ -630,12 +1357,18 @@
     gcc_exec_prefix_setting="ok"
     ;;
 esac
-echo "$ac_t""$gcc_exec_prefix_setting" 1>&6
+echo "$as_me:$LINENO: result: $gcc_exec_prefix_setting" >&5
+echo "${ECHO_T}$gcc_exec_prefix_setting" >&6
 if test "$gcc_exec_prefix_setting" != "ok"; then
-{ echo "configure: error: 
+{ { echo "$as_me:$LINENO: error:
+*** GCC_EXEC_PREFIX shouldn't contain the current directory when
+*** building gcc. Please change the environment variable
+*** and run configure again." >&5
+echo "$as_me: error:
 *** GCC_EXEC_PREFIX shouldn't contain the current directory when
 *** building gcc. Please change the environment variable
-*** and run configure again." 1>&2; exit 1; }
+*** and run configure again." >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
 # Check for additional parameters
@@ -647,10 +1380,10 @@
   gnu_ld_flag="$with_gnu_ld"
 else
   gnu_ld_flag=no
-fi
-
+fi;
 
 # With pre-defined ld
+
 # Check whether --with-ld or --without-ld was given.
 if test "${with_ld+set}" = set; then
   withval="$with_ld"
@@ -655,17 +1388,17 @@
 if test "${with_ld+set}" = set; then
   withval="$with_ld"
   DEFAULT_LINKER="$with_ld"
-fi
-
+fi;
 if test x"${DEFAULT_LINKER+set}" = x"set"; then
   if test ! -x "$DEFAULT_LINKER"; then
-    echo "configure: warning: cannot execute: $DEFAULT_LINKER: check --with-ld or env. var. DEFAULT_LINKER" 1>&2
+    { echo "$as_me:$LINENO: WARNING: cannot execute: $DEFAULT_LINKER: check --with-ld or env. var. DEFAULT_LINKER" >&5
+echo "$as_me: WARNING: cannot execute: $DEFAULT_LINKER: check --with-ld or env. var. DEFAULT_LINKER" >&2;}
   elif $DEFAULT_LINKER -v < /dev/null 2>&1 | grep GNU > /dev/null; then
     gnu_ld_flag=yes
   fi
-  cat >> confdefs.h <<EOF
+  cat >>confdefs.h <<_ACEOF
 #define DEFAULT_LINKER "$DEFAULT_LINKER"
-EOF
+_ACEOF
 
 fi
 
@@ -676,24 +1409,24 @@
   gas_flag="$with_gnu_as"
 else
   gas_flag=no
-fi
+fi;
 
 
 # Check whether --with-as or --without-as was given.
 if test "${with_as+set}" = set; then
   withval="$with_as"
   DEFAULT_ASSEMBLER="$with_as"
-fi
-
+fi;
 if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then
   if test ! -x "$DEFAULT_ASSEMBLER"; then
-    echo "configure: warning: cannot execute: $DEFAULT_ASSEMBLER: check --with-as or env. var. DEFAULT_ASSEMBLER" 1>&2
+    { echo "$as_me:$LINENO: WARNING: cannot execute: $DEFAULT_ASSEMBLER: check --with-as or env. var. DEFAULT_ASSEMBLER" >&5
+echo "$as_me: WARNING: cannot execute: $DEFAULT_ASSEMBLER: check --with-as or env. var. DEFAULT_ASSEMBLER" >&2;}
   elif $DEFAULT_ASSEMBLER -v < /dev/null 2>&1 | grep GNU > /dev/null; then
     gas_flag=yes
   fi
-  cat >> confdefs.h <<EOF
+  cat >>confdefs.h <<_ACEOF
 #define DEFAULT_ASSEMBLER "$DEFAULT_ASSEMBLER"
-EOF
+_ACEOF
 
 fi
 
@@ -704,10 +1437,10 @@
   stabs="$with_stabs"
 else
   stabs=no
-fi
-
+fi;
 
 # With ELF
+
 # Check whether --with-elf or --without-elf was given.
 if test "${with_elf+set}" = set; then
   withval="$with_elf"
@@ -714,8 +1447,7 @@
   elf="$with_elf"
 else
   elf=no
-fi
-
+fi;
 
 # Specify the local prefix
 local_prefix=
@@ -723,12 +1455,13 @@
 if test "${with_local_prefix+set}" = set; then
   withval="$with_local_prefix"
   case "${withval}" in
-yes)	{ echo "configure: error: bad value ${withval} given for local include directory prefix" 1>&2; exit 1; } ;;
+yes)	{ { echo "$as_me:$LINENO: error: bad value ${withval} given for local include directory prefix" >&5
+echo "$as_me: error: bad value ${withval} given for local include directory prefix" >&2;}
+   { (exit 1); exit 1; }; } ;;
 no)	;;
 *)	local_prefix=$with_local_prefix ;;
 esac
-fi
-
+fi;
 
 # Default local prefix if it is empty
 if test x$local_prefix = x; then
@@ -744,12 +1477,13 @@
 if test "${with_gxx_include_dir+set}" = set; then
   withval="$with_gxx_include_dir"
   case "${withval}" in
-yes)	{ echo "configure: error: bad value ${withval} given for g++ include directory" 1>&2; exit 1; } ;;
+yes)	{ { echo "$as_me:$LINENO: error: bad value ${withval} given for g++ include directory" >&5
+echo "$as_me: error: bad value ${withval} given for g++ include directory" >&2;}
+   { (exit 1); exit 1; }; } ;;
 no)	;;
 *)	gcc_gxx_include_dir=$with_gxx_include_dir ;;
 esac
-fi
-
+fi;
 
 if test x${gcc_gxx_include_dir} = x; then
   if test x${enable_version_specific_runtime_libs} = xyes; then
@@ -765,35 +1499,37 @@
 if test "${enable_checking+set}" = set; then
   enableval="$enable_checking"
   case "${enableval}" in
-yes)	cat >> confdefs.h <<\EOF
+yes)	cat >>confdefs.h <<\_ACEOF
 #define ENABLE_CHECKING 1
-EOF
+_ACEOF
  ;;
 no)	;;
-*)	{ echo "configure: error: bad value ${enableval} given for checking option" 1>&2; exit 1; } ;;
+*)	{ { echo "$as_me:$LINENO: error: bad value ${enableval} given for checking option" >&5
+echo "$as_me: error: bad value ${enableval} given for checking option" >&2;}
+   { (exit 1); exit 1; }; } ;;
 esac
-fi
-
+fi;
 
 # Check whether --enable-cpp or --disable-cpp was given.
 if test "${enable_cpp+set}" = set; then
   enableval="$enable_cpp"
-  :
+
 else
   enable_cpp=yes
-fi
+fi;
 
 
 # Check whether --with-cpp_install_dir or --without-cpp_install_dir was given.
 if test "${with_cpp_install_dir+set}" = set; then
   withval="$with_cpp_install_dir"
   if test x$withval = xyes; then
-  { echo "configure: error: option --with-cpp-install-dir requires an argument" 1>&2; exit 1; }
+  { { echo "$as_me:$LINENO: error: option --with-cpp-install-dir requires an argument" >&5
+echo "$as_me: error: option --with-cpp-install-dir requires an argument" >&2;}
+   { (exit 1); exit 1; }; }
 elif test x$withval != xno; then
   cpp_install_dir=$withval
 fi
-fi
-
+fi;
 
 # Use cpplib+cppmain for the preprocessor, but don't link it with the compiler.
 cpp_main=cccp
@@ -803,8 +1539,7 @@
   if test x$enable_cpplib != xno; then
   cpp_main=cppmain
 fi
-fi
-
+fi;
 
 # Link cpplib into the compiler proper, for C/C++/ObjC.
 # Check whether --enable-c-cpplib or --disable-c-cpplib was given.
@@ -816,8 +1551,7 @@
   extra_c_flags="${extra_c_flags} -DUSE_CPPLIB=1"
   cpp_main=cppmain
 fi
-fi
-
+fi;
 
 # Enable Multibyte Characters for C/C++
 # Check whether --enable-c-mbchar or --disable-c-mbchar was given.
@@ -826,8 +1560,7 @@
   if test x$enable_c_mbchar != xno; then
   extra_c_flags=-DMULTIBYTE_CHARS=1
 fi
-fi
-
+fi;
 
 # Disable fast fixincludes
 # Check whether --enable-fast-fixincludes or --disable-fast-fixincludes was given.
@@ -836,16 +1569,14 @@
   if test x$enable_fast_fixincludes = xno ; then
   cp $srcdir/fixincludes ./fixinc.sh
 fi
-fi
-
+fi;
 
 # Enable Haifa scheduler.
 # Check whether --enable-haifa or --disable-haifa was given.
 if test "${enable_haifa+set}" = set; then
   enableval="$enable_haifa"
-  :
-fi
 
+fi;
 
 # Enable threads
 # Pass with no value to take the default
@@ -858,8 +1589,7 @@
 fi
 else
   enable_threads=''
-fi
-
+fi;
 
 enable_threads_flag=$enable_threads
 # Check if a valid thread package
@@ -892,8 +1622,7 @@
 fi
 else
   objc_boehm_gc=''
-fi
-
+fi;
 
 # Check whether --enable-java-gc or --disable-java-gc was given.
 if test "${enable_java_gc+set}" = set; then
@@ -902,7 +1631,7 @@
   JAVAGC=$enableval
 else
   JAVAGC=boehm
-fi
+fi;
 
 
 # Check whether --with-dwarf2 or --without-dwarf2 was given.
@@ -911,8 +1640,7 @@
   dwarf2="$with_dwarf2"
 else
   dwarf2=no
-fi
-
+fi;
 
 # Determine the host, build, and target systems
 ac_aux_dir=
@@ -925,314 +1653,742 @@
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/install.sh -c"
     break
+  elif test -f $ac_dir/shtool; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
   fi
 done
 if test -z "$ac_aux_dir"; then
-  { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
-fi
-ac_config_guess=$ac_aux_dir/config.guess
-ac_config_sub=$ac_aux_dir/config.sub
-ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
 
+# Make sure we can run config.sub.
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6
+if test "${ac_cv_build+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_build_alias=$build_alias
+test -z "$ac_cv_build_alias" &&
+  ac_cv_build_alias=`$ac_config_guess`
+test -z "$ac_cv_build_alias" &&
+  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6
+build=$ac_cv_build
+build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6
+if test "${ac_cv_host+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_host_alias=$host_alias
+test -z "$ac_cv_host_alias" &&
+  ac_cv_host_alias=$ac_cv_build_alias
+ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6
+host=$ac_cv_host
+host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking target system type" >&5
+echo $ECHO_N "checking target system type... $ECHO_C" >&6
+if test "${ac_cv_target+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_target_alias=$target_alias
+test "x$ac_cv_target_alias" = "x" &&
+  ac_cv_target_alias=$ac_cv_host_alias
+ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+echo "${ECHO_T}$ac_cv_target" >&6
+target=$ac_cv_target
+target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 
-# Do some error checking and defaulting for the host and target type.
-# The inputs are:
-#    configure --host=HOST --target=TARGET --build=BUILD NONOPT
-#
-# The rules are:
-# 1. You are not allowed to specify --host, --target, and nonopt at the
-#    same time.
-# 2. Host defaults to nonopt.
-# 3. If nonopt is not specified, then host defaults to the current host,
-#    as determined by config.guess.
-# 4. Target and build default to nonopt.
-# 5. If nonopt is not specified, then target and build default to host.
 
 # The aliases save the names the user supplied, while $host etc.
 # will get canonicalized.
-case $host---$target---$nonopt in
-NONE---*---* | *---NONE---* | *---*---NONE) ;;
-*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
-esac
+test -n "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
 
+# Find the native compiler
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 
-# Make sure we can run config.sub.
-if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
-else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:966: checking host system type" >&5
-
-host_alias=$host
-case "$host_alias" in
-NONE)
-  case $nonopt in
-  NONE)
-    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
-    else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
-    fi ;;
-  *) host_alias=$nonopt ;;
-  esac ;;
-esac
-
-host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
-host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$host" 1>&6
-
-echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:987: checking target system type" >&5
-
-target_alias=$target
-case "$target_alias" in
-NONE)
-  case $nonopt in
-  NONE) target_alias=$host_alias ;;
-  *) target_alias=$nonopt ;;
-  esac ;;
-esac
-
-target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
-target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$target" 1>&6
-
-echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1005: checking build system type" >&5
-
-build_alias=$build
-case "$build_alias" in
-NONE)
-  case $nonopt in
-  NONE) build_alias=$host_alias ;;
-  *) build_alias=$nonopt ;;
-  esac ;;
-esac
-
-build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
-build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$build" 1>&6
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 
-test "$host_alias" != "$target_alias" &&
-  test "$program_prefix$program_suffix$program_transform_name" = \
-    NONENONEs,x,x, &&
-  program_prefix=${target_alias}-
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
 
+  CC=$ac_ct_CC
+else
+  CC="$ac_cv_prog_CC"
+fi
 
-# Find the native compiler
-# Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1032: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_CC="gcc"
-      break
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
     fi
-  done
-  IFS="$ac_save_ifs"
+done
+done
+
 fi
 fi
-CC="$ac_cv_prog_CC"
+CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$ac_t""$CC" 1>&6
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
 else
-  echo "$ac_t""no" 1>&6
+  CC="$ac_cv_prog_CC"
 fi
 
+fi
 if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1062: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
         ac_prog_rejected=yes
 	continue
       fi
       ac_cv_prog_CC="cc"
-      break
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
     fi
-  done
-  IFS="$ac_save_ifs"
+done
+done
+
 if test $ac_prog_rejected = yes; then
   # We found a bogon in the path, so make sure we never use it.
   set dummy $ac_cv_prog_CC
   shift
-  if test $# -gt 0; then
+  if test $# != 0; then
     # We chose a different compiler from the bogus one.
     # However, it has the same basename, so the bogon will be chosen
     # first if we set CC to just the basename; use the full file name.
     shift
-    set dummy "$ac_dir/$ac_word" "$@"
-    shift
-    ac_cv_prog_CC="$@"
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
   fi
 fi
 fi
 fi
-CC="$ac_cv_prog_CC"
+CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$ac_t""$CC" 1>&6
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-  if test -z "$CC"; then
-    case "`uname -s`" in
-    *win32* | *WIN32*)
-      # Extract the first word of "cl", so it can be a program name with args.
-set dummy cl; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1113: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_CC="cl"
-      break
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
     fi
-  done
-  IFS="$ac_save_ifs"
+done
+done
+
 fi
 fi
-CC="$ac_cv_prog_CC"
+CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$ac_t""$CC" 1>&6
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
- ;;
-    esac
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
   fi
-  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+done
+done
+
 fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ac_ct_CC" && break
+done
 
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1145: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+  CC=$ac_ct_CC
+fi
 
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
+fi
 
-cat > conftest.$ac_ext << EOF
 
-#line 1156 "configure"
-#include "confdefs.h"
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+     "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-main(){return(0);}
-EOF
-if { (eval echo configure:1161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  ac_cv_prog_cc_works=yes
-  # If we can't run a trivial program, we are probably using a cross compiler.
-  if (./conftest; exit) 2>/dev/null; then
-    ac_cv_prog_cc_cross=no
-  else
-    ac_cv_prog_cc_cross=yes
-  fi
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  ac_cv_prog_cc_works=no
-fi
-rm -fr conftest*
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
-if test $ac_cv_prog_cc_works = no; then
-  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
-fi
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1187: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
-echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
-cross_compiling=$ac_cv_prog_cc_cross
-
-echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1192: checking whether we are using GNU C" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C compiler default output" >&5
+echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+  (eval $ac_link_default) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Find the output, starting from the most likely.  This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+        ;;
+    conftest.$ac_ext )
+        # This is the source file.
+        ;;
+    [ab].out )
+        # We found the default executable, but exeext='' is most
+        # certainly right.
+        break;;
+    *.* )
+        ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+        # FIXME: I believe we export ac_cv_exeext for Libtool,
+        # but it would be cool to find out if it's true.  Does anybody
+        # maintain Libtool? --akim.
+        export ac_cv_exeext
+        break;;
+    * )
+        break;;
+  esac
+done
 else
-  cat > conftest.c <<EOF
-#ifdef __GNUC__
-  yes;
-#endif
-EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1201: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
-  ac_cv_prog_gcc=yes
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+          export ac_cv_exeext
+          break;;
+    * ) break;;
+  esac
+done
 else
-  ac_cv_prog_gcc=no
-fi
-fi
+  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+int
+main ()
+{
 
-if test $ac_cv_prog_gcc = yes; then
-  GCC=yes
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
 else
-  GCC=
-fi
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_test_CFLAGS="${CFLAGS+set}"
-ac_save_CFLAGS="$CFLAGS"
-CFLAGS=
-echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1220: checking whether ${CC-cc} accepts -g" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_prog_cc_g=yes
 else
-  ac_cv_prog_cc_g=no
-fi
-rm -f conftest*
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+ac_cv_prog_cc_g=no
 fi
-
-echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
 if test "$ac_test_CFLAGS" = set; then
-  CFLAGS="$ac_save_CFLAGS"
+  CFLAGS=$ac_save_CFLAGS
 elif test $ac_cv_prog_cc_g = yes; then
   if test "$GCC" = yes; then
     CFLAGS="-g -O2"
@@ -1246,8 +2402,225 @@
     CFLAGS=
   fi
 fi
-
-
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX			-qlanglvl=ansi
+# Ultrix and OSF/1	-std1
+# HP-UX 10.20 and later	-Ae
+# HP-UX older versions	-Aa -D_HPUX_SOURCE
+# SVR4			-Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+  x|xno)
+    echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+  *)
+    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+    CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C.  Since we use `exit',
+# in C++ we need to declare it.  In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+  choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  for ac_declaration in \
+   ''\
+   '#include <stdlib.h>' \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);'
+do
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+  echo '#ifdef __cplusplus' >>confdefs.h
+  echo $ac_declaration      >>confdefs.h
+  echo '#endif'             >>confdefs.h
+fi
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
 # If the native compiler is GCC, we can enable warnings even in stage1.  
 # That's useful for people building cross-compilers, or just running a
 # quick `make'.
@@ -1258,175 +2631,355 @@
 fi
 
 
-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1263: checking whether ${MAKE-make} sets \${MAKE}" >&5
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftestmake <<\EOF
+  cat >conftest.make <<\_ACEOF
 all:
-	@echo 'ac_maketemp="${MAKE}"'
-EOF
+	@echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
 if test -n "$ac_maketemp"; then
   eval ac_cv_prog_make_${ac_make}_set=yes
 else
   eval ac_cv_prog_make_${ac_make}_set=no
 fi
-rm -f conftestmake
+rm -f conftest.make
 fi
 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
   SET_MAKE=
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
   SET_MAKE="MAKE=${MAKE-make}"
 fi
 
 
-echo $ac_n "checking whether a default assembler was specified""... $ac_c" 1>&6
-echo "configure:1291: checking whether a default assembler was specified" >&5
+echo "$as_me:$LINENO: checking whether a default assembler was specified" >&5
+echo $ECHO_N "checking whether a default assembler was specified... $ECHO_C" >&6
 if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then
     if test x"$gas_flag" = x"no"; then
-    	echo "$ac_t""yes ($DEFAULT_ASSEMBLER)" 1>&6
+    	echo "$as_me:$LINENO: result: yes ($DEFAULT_ASSEMBLER)" >&5
+echo "${ECHO_T}yes ($DEFAULT_ASSEMBLER)" >&6
     else
-	echo "$ac_t""yes ($DEFAULT_ASSEMBLER - GNU as)" 1>&6
+	echo "$as_me:$LINENO: result: yes ($DEFAULT_ASSEMBLER - GNU as)" >&5
+echo "${ECHO_T}yes ($DEFAULT_ASSEMBLER - GNU as)" >&6
     fi
 else
-    echo "$ac_t""no" 1>&6
+    echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-echo $ac_n "checking whether a default linker was specified""... $ac_c" 1>&6
-echo "configure:1303: checking whether a default linker was specified" >&5
+echo "$as_me:$LINENO: checking whether a default linker was specified" >&5
+echo $ECHO_N "checking whether a default linker was specified... $ECHO_C" >&6
 if test x"${DEFAULT_LINKER+set}" = x"set"; then
     if test x"$gnu_ld_flag" = x"no"; then
-	echo "$ac_t""yes ($DEFAULT_LINKER)" 1>&6
+	echo "$as_me:$LINENO: result: yes ($DEFAULT_LINKER)" >&5
+echo "${ECHO_T}yes ($DEFAULT_LINKER)" >&6
     else
-	echo "$ac_t""yes ($DEFAULT_LINKER - GNU ld)" 1>&6
+	echo "$as_me:$LINENO: result: yes ($DEFAULT_LINKER - GNU ld)" >&5
+echo "${ECHO_T}yes ($DEFAULT_LINKER - GNU ld)" >&6
     fi
 else
-    echo "$ac_t""no" 1>&6
+    echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
 # Find some useful tools
 for ac_prog in gawk mawk nawk awk
 do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1320: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test -n "$AWK"; then
   ac_cv_prog_AWK="$AWK" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
       ac_cv_prog_AWK="$ac_prog"
-      break
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
     fi
-  done
-  IFS="$ac_save_ifs"
+done
+done
+
 fi
 fi
-AWK="$ac_cv_prog_AWK"
+AWK=$ac_cv_prog_AWK
 if test -n "$AWK"; then
-  echo "$ac_t""$AWK" 1>&6
+  echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-test -n "$AWK" && break
+  test -n "$AWK" && break
 done
 
-# Extract the first word of "flex", so it can be a program name with args.
-set dummy flex; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1352: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+
+for ac_prog in flex lex
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_LEX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test -n "$LEX"; then
   ac_cv_prog_LEX="$LEX" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_LEX="flex"
-      break
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_LEX="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
     fi
-  done
-  IFS="$ac_save_ifs"
-  test -z "$ac_cv_prog_LEX" && ac_cv_prog_LEX="lex"
+done
+done
+
 fi
 fi
-LEX="$ac_cv_prog_LEX"
+LEX=$ac_cv_prog_LEX
 if test -n "$LEX"; then
-  echo "$ac_t""$LEX" 1>&6
+  echo "$as_me:$LINENO: result: $LEX" >&5
+echo "${ECHO_T}$LEX" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
+  test -n "$LEX" && break
+done
+test -n "$LEX" || LEX=":"
+
 if test -z "$LEXLIB"
 then
-  case "$LEX" in
-  flex*) ac_lib=fl ;;
-  *) ac_lib=l ;;
-  esac
-  echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
-echo "configure:1386: checking for yywrap in -l$ac_lib" >&5
-ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-l$ac_lib  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1394 "configure"
-#include "confdefs.h"
+  echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5
+echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6
+if test "${ac_cv_lib_fl_yywrap+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lfl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char yywrap();
+char yywrap ();
+int
+main ()
+{
+yywrap ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_fl_yywrap=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_fl_yywrap=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5
+echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6
+if test $ac_cv_lib_fl_yywrap = yes; then
+  LEXLIB="-lfl"
+else
+  echo "$as_me:$LINENO: checking for yywrap in -ll" >&5
+echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6
+if test "${ac_cv_lib_l_yywrap+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ll  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-int main() {
-yywrap()
-; return 0; }
-EOF
-if { (eval echo configure:1405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char yywrap ();
+int
+main ()
+{
+yywrap ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_l_yywrap=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_l_yywrap=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5
+echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6
+if test $ac_cv_lib_l_yywrap = yes; then
+  LEXLIB="-ll"
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  LEXLIB="-l$ac_lib"
-else
-  echo "$ac_t""no" 1>&6
-fi
 
 fi
 
-echo $ac_n "checking whether ln works""... $ac_c" 1>&6
-echo "configure:1428: checking whether ln works" >&5
-if eval "test \"`echo '$''{'gcc_cv_prog_LN'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+if test "x$LEX" != "x:"; then
+  echo "$as_me:$LINENO: checking lex output file root" >&5
+echo $ECHO_N "checking lex output file root... $ECHO_C" >&6
+if test "${ac_cv_prog_lex_root+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # The minimal lex program is just a single line: %%.  But some broken lexes
+# (Solaris, I think it was) want two %% lines, so accommodate them.
+cat >conftest.l <<_ACEOF
+%%
+%%
+_ACEOF
+{ (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5
+  (eval $LEX conftest.l) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+if test -f lex.yy.c; then
+  ac_cv_prog_lex_root=lex.yy
+elif test -f lexyy.c; then
+  ac_cv_prog_lex_root=lexyy
+else
+  { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5
+echo "$as_me: error: cannot find output from $LEX; giving up" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5
+echo "${ECHO_T}$ac_cv_prog_lex_root" >&6
+rm -f conftest.l
+LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
+
+echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5
+echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6
+if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # POSIX says lex can declare yytext either as a pointer or an array; the
+# default is implementation-dependent. Figure out which it is, since
+# not all implementations provide the %pointer and %array declarations.
+ac_cv_prog_lex_yytext_pointer=no
+echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
+ac_save_LIBS=$LIBS
+LIBS="$LIBS $LEXLIB"
+cat >conftest.$ac_ext <<_ACEOF
+`cat $LEX_OUTPUT_ROOT.c`
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_lex_yytext_pointer=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_save_LIBS
+rm -f "${LEX_OUTPUT_ROOT}.c"
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5
+echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6
+if test $ac_cv_prog_lex_yytext_pointer = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define YYTEXT_POINTER 1
+_ACEOF
+
+fi
+
+fi
+echo "$as_me:$LINENO: checking whether ln works" >&5
+echo $ECHO_N "checking whether ln works... $ECHO_C" >&6
+if test "${gcc_cv_prog_LN+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   rm -f conftestdata_t
 echo >conftestdata_f
@@ -1446,19 +2999,22 @@
 fi
 LN="$gcc_cv_prog_LN"
 if test "$gcc_cv_prog_LN" = "ln"; then
-  echo "$ac_t""yes" 1>&6
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
 else
   if test "$gcc_cv_prog_LN" = "ln -s"; then
-    echo "$ac_t""no, using ln -s" 1>&6
+    echo "$as_me:$LINENO: result: no, using ln -s" >&5
+echo "${ECHO_T}no, using ln -s" >&6
   else
-    echo "$ac_t""no, and neither does ln -s, so using cp" 1>&6
+    echo "$as_me:$LINENO: result: no, and neither does ln -s, so using cp" >&5
+echo "${ECHO_T}no, and neither does ln -s, so using cp" >&6
   fi
 fi
 
-echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1460: checking whether ln -s works" >&5
-if eval "test \"`echo '$''{'gcc_cv_prog_LN_S'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+if test "${gcc_cv_prog_LN_S+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   rm -f conftestdata_t
 echo >conftestdata_f
@@ -1478,110 +3034,187 @@
 fi
 LN_S="$gcc_cv_prog_LN_S"
 if test "$gcc_cv_prog_LN_S" = "ln -s"; then
-  echo "$ac_t""yes" 1>&6
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
 else
   if test "$gcc_cv_prog_LN_S" = "ln"; then
-    echo "$ac_t""no, using ln" 1>&6
+    echo "$as_me:$LINENO: result: no, using ln" >&5
+echo "${ECHO_T}no, using ln" >&6
   else
-    echo "$ac_t""no, and neither does ln, so using cp" 1>&6
+    echo "$as_me:$LINENO: result: no, and neither does ln, so using cp" >&5
+echo "${ECHO_T}no, and neither does ln, so using cp" >&6
   fi
 fi
 
-echo $ac_n "checking for volatile""... $ac_c" 1>&6
-echo "configure:1492: checking for volatile" >&5
-if eval "test \"`echo '$''{'gcc_cv_c_volatile'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1497 "configure"
-#include "confdefs.h"
+echo "$as_me:$LINENO: checking for volatile" >&5
+echo $ECHO_N "checking for volatile... $ECHO_C" >&6
+if test "${gcc_cv_c_volatile+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-int main() {
+int
+main ()
+{
 volatile int foo;
-; return 0; }
-EOF
-if { (eval echo configure:1504: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   gcc_cv_c_volatile=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  gcc_cv_c_volatile=no
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+gcc_cv_c_volatile=no
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-
-echo "$ac_t""$gcc_cv_c_volatile" 1>&6
+echo "$as_me:$LINENO: result: $gcc_cv_c_volatile" >&5
+echo "${ECHO_T}$gcc_cv_c_volatile" >&6
 if test $gcc_cv_c_volatile = yes ; then
-  cat >> confdefs.h <<\EOF
+  cat >>confdefs.h <<\_ACEOF
 #define HAVE_VOLATILE 1
-EOF
+_ACEOF
 
 fi
 
-# Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1527: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_RANLIB="ranlib"
-      break
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
     fi
-  done
-  IFS="$ac_save_ifs"
-  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+done
+done
+
 fi
 fi
-RANLIB="$ac_cv_prog_RANLIB"
+RANLIB=$ac_cv_prog_RANLIB
 if test -n "$RANLIB"; then
-  echo "$ac_t""$RANLIB" 1>&6
+  echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  RANLIB=$ac_ct_RANLIB
 else
-  echo "$ac_t""no" 1>&6
+  RANLIB="$ac_cv_prog_RANLIB"
 fi
 
 for ac_prog in 'bison -y' byacc
 do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1559: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_YACC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test -n "$YACC"; then
   ac_cv_prog_YACC="$YACC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
       ac_cv_prog_YACC="$ac_prog"
-      break
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
     fi
-  done
-  IFS="$ac_save_ifs"
+done
+done
+
 fi
 fi
-YACC="$ac_cv_prog_YACC"
+YACC=$ac_cv_prog_YACC
 if test -n "$YACC"; then
-  echo "$ac_t""$YACC" 1>&6
+  echo "$as_me:$LINENO: result: $YACC" >&5
+echo "${ECHO_T}$YACC" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-test -n "$YACC" && break
+  test -n "$YACC" && break
 done
 test -n "$YACC" || YACC="yacc"
 
@@ -1595,11 +3228,11 @@
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
-echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1600: checking for a BSD compatible install" >&5
+echo "$as_me:$LINENO: checking for a BSD compatible install" >&5
+echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
 if test -z "$INSTALL"; then
-if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
     IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="${IFS}:"
   for ac_dir in $PATH; do
@@ -1637,7 +3270,8 @@
     INSTALL="$ac_install_sh"
   fi
 fi
-echo "$ac_t""$INSTALL" 1>&6
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
 # It thinks the first close brace ends the variable substitution.
@@ -1646,126 +3280,318 @@
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1651: checking how to run the C preprocessor" >&5
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
-if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-    # This must be in double quotes, not single quotes, because CPP may get
-  # substituted into the Makefile and "${CC-cc}" will confuse make.
-  CPP="${CC-cc} -E"
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp.
-  cat > conftest.$ac_ext <<EOF
-#line 1666 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1672: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  :
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  CPP="${CC-cc} -E -traditional-cpp"
-  cat > conftest.$ac_ext <<EOF
-#line 1683 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1689: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  :
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                     Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  CPP="${CC-cc} -nologo -E"
-  cat > conftest.$ac_ext <<EOF
-#line 1700 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1706: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
   :
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  CPP=/lib/cpp
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
 fi
-rm -f conftest*
-  ac_cv_prog_CPP="$CPP"
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                     Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
 fi
-  CPP="$ac_cv_prog_CPP"
+if test -z "$ac_cpp_err"; then
+  :
 else
-  ac_cv_prog_CPP="$CPP"
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
 fi
-echo "$ac_t""$CPP" 1>&6
+rm -f conftest.err conftest.$ac_ext
 
-echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1731: checking for ANSI C header files" >&5
-if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
 else
-  cat > conftest.$ac_ext <<EOF
-#line 1736 "configure"
-#include "confdefs.h"
+  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+    then ac_cv_prog_egrep='grep -E'
+    else ac_cv_prog_egrep='egrep'
+    fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
 #include <float.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1744: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_header_stdc=yes
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_header_stdc=no
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 1761 "configure"
-#include "confdefs.h"
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <string.h>
-EOF
+
+_ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "memchr" >/dev/null 2>&1; then
+  $EGREP "memchr" >/dev/null 2>&1; then
   :
 else
-  rm -rf conftest*
   ac_cv_header_stdc=no
 fi
 rm -f conftest*
@@ -1774,16 +3600,20 @@
 
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 1779 "configure"
-#include "confdefs.h"
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <stdlib.h>
-EOF
+
+_ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "free" >/dev/null 2>&1; then
+  $EGREP "free" >/dev/null 2>&1; then
   :
 else
-  rm -rf conftest*
   ac_cv_header_stdc=no
 fi
 rm -f conftest*
@@ -1792,367 +3622,883 @@
 
 if test $ac_cv_header_stdc = yes; then
   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-if test "$cross_compiling" = yes; then
+  if test "$cross_compiling" = yes; then
   :
 else
-  cat > conftest.$ac_ext <<EOF
-#line 1800 "configure"
-#include "confdefs.h"
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <ctype.h>
-#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int main () { int i; for (i = 0; i < 256; i++)
-if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
-exit (0); }
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                   (('a' <= (c) && (c) <= 'i') \
+                     || ('j' <= (c) && (c) <= 'r') \
+                     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
 
-EOF
-if { (eval echo configure:1811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+        || toupper (i) != TOUPPER (i))
+      exit(2);
+  exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   :
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_header_stdc=no
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
 fi
-rm -fr conftest*
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-
 fi
 fi
-
-echo "$ac_t""$ac_cv_header_stdc" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
 if test $ac_cv_header_stdc = yes; then
-  cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
 #define STDC_HEADERS 1
-EOF
+_ACEOF
 
 fi
 
-echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1835: checking whether time.h and sys/time.h may both be included" >&5
-if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1840 "configure"
-#include "confdefs.h"
+echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
+echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
+if test "${ac_cv_header_time+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <sys/types.h>
 #include <sys/time.h>
 #include <time.h>
-int main() {
-struct tm *tp;
-; return 0; }
-EOF
-if { (eval echo configure:1849: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+
+int
+main ()
+{
+if ((struct tm *) 0)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_header_time=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_header_time=no
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_time=no
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-
-echo "$ac_t""$ac_cv_header_time" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
+echo "${ECHO_T}$ac_cv_header_time" >&6
 if test $ac_cv_header_time = yes; then
-  cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
 #define TIME_WITH_SYS_TIME 1
-EOF
+_ACEOF
 
 fi
 
-echo $ac_n "checking whether string.h and strings.h may both be included""... $ac_c" 1>&6
-echo "configure:1870: checking whether string.h and strings.h may both be included" >&5
-if eval "test \"`echo '$''{'gcc_cv_header_string'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1875 "configure"
-#include "confdefs.h"
+echo "$as_me:$LINENO: checking whether string.h and strings.h may both be included" >&5
+echo $ECHO_N "checking whether string.h and strings.h may both be included... $ECHO_C" >&6
+if test "${gcc_cv_header_string+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <string.h>
 #include <strings.h>
-int main() {
+int
+main ()
+{
 
-; return 0; }
-EOF
-if { (eval echo configure:1883: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   gcc_cv_header_string=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  gcc_cv_header_string=no
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+gcc_cv_header_string=no
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-
-echo "$ac_t""$gcc_cv_header_string" 1>&6
+echo "$as_me:$LINENO: result: $gcc_cv_header_string" >&5
+echo "${ECHO_T}$gcc_cv_header_string" >&6
 if test $gcc_cv_header_string = yes; then
-  cat >> confdefs.h <<\EOF
+  cat >>confdefs.h <<\_ACEOF
 #define STRING_WITH_STRINGS 1
-EOF
+_ACEOF
 
 fi
 
-echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:1904: checking for sys/wait.h that is POSIX.1 compatible" >&5
-if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1909 "configure"
-#include "confdefs.h"
+echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6
+if test "${ac_cv_header_sys_wait_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <sys/types.h>
 #include <sys/wait.h>
 #ifndef WEXITSTATUS
-#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
 #endif
 #ifndef WIFEXITED
-#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
 #endif
-int main() {
-int s;
-wait (&s);
-s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
-; return 0; }
-EOF
-if { (eval echo configure:1925: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ac_cv_header_sys_wait_h=yes
+
+int
+main ()
+{
+  int s;
+  wait (&s);
+  s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_header_sys_wait_h=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_header_sys_wait_h=no
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_sys_wait_h=no
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-
-echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6
 if test $ac_cv_header_sys_wait_h = yes; then
-  cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
 #define HAVE_SYS_WAIT_H 1
-EOF
+_ACEOF
 
 fi
 
-for ac_hdr in limits.h stddef.h string.h strings.h stdlib.h time.h fcntl.h unistd.h stab.h sys/file.h sys/time.h sys/resource.h sys/param.h sys/times.h sys/stat.h direct.h
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                  inttypes.h stdint.h unistd.h
 do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1949: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1954 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1959: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
  
+done
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_header in limits.h stddef.h string.h strings.h stdlib.h time.h fcntl.h unistd.h stab.h sys/file.h sys/time.h sys/resource.h sys/param.h sys/times.h sys/stat.h direct.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+  yes:no )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+  no:yes )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo "$ac_t""no" 1>&6
+  eval "$as_ac_Header=$ac_header_preproc"
 fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
 done
 
 
 # Check for thread headers.
-ac_safe=`echo "thread.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for thread.h""... $ac_c" 1>&6
-echo "configure:1989: checking for thread.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1994 "configure"
-#include "confdefs.h"
+if test "${ac_cv_header_thread_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for thread.h" >&5
+echo $ECHO_N "checking for thread.h... $ECHO_C" >&6
+if test "${ac_cv_header_thread_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_thread_h" >&5
+echo "${ECHO_T}$ac_cv_header_thread_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking thread.h usability" >&5
+echo $ECHO_N "checking thread.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
 #include <thread.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1999: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking thread.h presence" >&5
+echo $ECHO_N "checking thread.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <thread.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+  yes:no )
+    { echo "$as_me:$LINENO: WARNING: thread.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: thread.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: thread.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: thread.h: proceeding with the preprocessor's result" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+  no:yes )
+    { echo "$as_me:$LINENO: WARNING: thread.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: thread.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: thread.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: thread.h: check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: thread.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: thread.h: proceeding with the preprocessor's result" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for thread.h" >&5
+echo $ECHO_N "checking for thread.h... $ECHO_C" >&6
+if test "${ac_cv_header_thread_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_thread_h=$ac_header_preproc
 fi
-rm -f conftest*
+echo "$as_me:$LINENO: result: $ac_cv_header_thread_h" >&5
+echo "${ECHO_T}$ac_cv_header_thread_h" >&6
+
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+if test $ac_cv_header_thread_h = yes; then
   have_thread_h=yes
 else
-  echo "$ac_t""no" 1>&6
-have_thread_h=
+  have_thread_h=
 fi
 
-ac_safe=`echo "pthread.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for pthread.h""... $ac_c" 1>&6
-echo "configure:2023: checking for pthread.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 2028 "configure"
-#include "confdefs.h"
+
+if test "${ac_cv_header_pthread_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for pthread.h" >&5
+echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
+if test "${ac_cv_header_pthread_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5
+echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking pthread.h usability" >&5
+echo $ECHO_N "checking pthread.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
 #include <pthread.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2033: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking pthread.h presence" >&5
+echo $ECHO_N "checking pthread.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <pthread.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+  yes:no )
+    { echo "$as_me:$LINENO: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+  no:yes )
+    { echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: pthread.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: pthread.h: check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for pthread.h" >&5
+echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
+if test "${ac_cv_header_pthread_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_pthread_h=$ac_header_preproc
 fi
-rm -f conftest*
+echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5
+echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
+
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+if test $ac_cv_header_pthread_h = yes; then
   have_pthread_h=yes
 else
-  echo "$ac_t""no" 1>&6
-have_pthread_h=
+  have_pthread_h=
 fi
 
 
 # See if GNAT has been installed
 # Extract the first word of "gnatbind", so it can be a program name with args.
 set dummy gnatbind; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2060: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gnat'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_gnat+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test -n "$gnat"; then
   ac_cv_prog_gnat="$gnat" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
       ac_cv_prog_gnat="yes"
-      break
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
     fi
-  done
-  IFS="$ac_save_ifs"
+done
+done
+
   test -z "$ac_cv_prog_gnat" && ac_cv_prog_gnat="no"
 fi
 fi
-gnat="$ac_cv_prog_gnat"
+gnat=$ac_cv_prog_gnat
 if test -n "$gnat"; then
-  echo "$ac_t""$gnat" 1>&6
+  echo "$as_me:$LINENO: result: $gnat" >&5
+echo "${ECHO_T}$gnat" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
 
 # See if the system preprocessor understands the ANSI C preprocessor
 # stringification operator.
-echo $ac_n "checking whether cpp understands the stringify operator""... $ac_c" 1>&6
-echo "configure:2091: checking whether cpp understands the stringify operator" >&5
-if eval "test \"`echo '$''{'gcc_cv_c_have_stringify'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 2096 "configure"
-#include "confdefs.h"
+echo "$as_me:$LINENO: checking whether cpp understands the stringify operator" >&5
+echo $ECHO_N "checking whether cpp understands the stringify operator... $ECHO_C" >&6
+if test "${gcc_cv_c_have_stringify+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-int main() {
+int
+main ()
+{
 #define S(x)   #x
 char *test = S(foo);
-; return 0; }
-EOF
-if { (eval echo configure:2104: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   gcc_cv_c_have_stringify=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  gcc_cv_c_have_stringify=no
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+gcc_cv_c_have_stringify=no
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 fi
 
-echo "$ac_t""$gcc_cv_c_have_stringify" 1>&6
+echo "$as_me:$LINENO: result: $gcc_cv_c_have_stringify" >&5
+echo "${ECHO_T}$gcc_cv_c_have_stringify" >&6
 if test $gcc_cv_c_have_stringify = yes; then
-  cat >> confdefs.h <<\EOF
+  cat >>confdefs.h <<\_ACEOF
 #define HAVE_CPP_STRINGIFY 1
-EOF
+_ACEOF
 
 fi
 
 # Use <inttypes.h> only if it exists,
 # doesn't clash with <sys/types.h>, and declares intmax_t.
-echo $ac_n "checking for inttypes.h""... $ac_c" 1>&6
-echo "configure:2127: checking for inttypes.h" >&5
-if eval "test \"`echo '$''{'gcc_cv_header_inttypes_h'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 2132 "configure"
-#include "confdefs.h"
+echo "$as_me:$LINENO: checking for inttypes.h" >&5
+echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6
+if test "${gcc_cv_header_inttypes_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <sys/types.h>
 #include <inttypes.h>
-int main() {
+int
+main ()
+{
 intmax_t i = -1;
-; return 0; }
-EOF
-if { (eval echo configure:2140: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   gcc_cv_header_inttypes_h=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  gcc_cv_header_inttypes_h=no
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+gcc_cv_header_inttypes_h=no
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 fi
 
-echo "$ac_t""$gcc_cv_header_inttypes_h" 1>&6
+echo "$as_me:$LINENO: result: $gcc_cv_header_inttypes_h" >&5
+echo "${ECHO_T}$gcc_cv_header_inttypes_h" >&6
 if test $gcc_cv_header_inttypes_h = yes; then
-  cat >> confdefs.h <<\EOF
+  cat >>confdefs.h <<\_ACEOF
 #define HAVE_INTTYPES_H 1
-EOF
+_ACEOF
 
 fi
 
@@ -2161,56 +4507,84 @@
 	sysconf isascii gettimeofday strsignal putc_unlocked fputc_unlocked \
 	fputs_unlocked
 do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2166: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 2171 "configure"
-#include "confdefs.h"
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
-#include <assert.h>
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
-int main() {
-
+char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
 #endif
 
-; return 0; }
-EOF
-if { (eval echo configure:2194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
  
-else
-  echo "$ac_t""no" 1>&6
 fi
 done
 
@@ -2218,110 +4592,170 @@
 # Make sure wchar_t is available
 #AC_CHECK_TYPE(wchar_t, unsigned int)
 
-echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:2223: checking for vprintf" >&5
-if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 2228 "configure"
-#include "confdefs.h"
+
+for ac_func in vprintf
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char vprintf(); below.  */
-#include <assert.h>
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char vprintf();
-
-int main() {
-
+char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_vprintf) || defined (__stub___vprintf)
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-vprintf();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
 #endif
 
-; return 0; }
-EOF
-if { (eval echo configure:2251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_vprintf=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_vprintf=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  cat >> confdefs.h <<\EOF
-#define HAVE_VPRINTF 1
-EOF
-
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-if test "$ac_cv_func_vprintf" != yes; then
-echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:2275: checking for _doprnt" >&5
-if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 2280 "configure"
-#include "confdefs.h"
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+echo "$as_me:$LINENO: checking for _doprnt" >&5
+echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6
+if test "${ac_cv_func__doprnt+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char _doprnt(); below.  */
-#include <assert.h>
+    which can conflict with char _doprnt (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char _doprnt();
-
-int main() {
-
+char _doprnt ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub__doprnt) || defined (__stub____doprnt)
 choke me
 #else
-_doprnt();
+char (*f) () = _doprnt;
+#endif
+#ifdef __cplusplus
+}
 #endif
 
-; return 0; }
-EOF
-if { (eval echo configure:2303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func__doprnt=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func__doprnt=no"
-fi
-rm -f conftest*
-fi
+int
+main ()
+{
+return f != _doprnt;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func__doprnt=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func__doprnt=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5
+echo "${ECHO_T}$ac_cv_func__doprnt" >&6
+if test $ac_cv_func__doprnt = yes; then
 
-if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\_ACEOF
 #define HAVE_DOPRNT 1
-EOF
+_ACEOF
 
-else
-  echo "$ac_t""no" 1>&6
 fi
 
 fi
+done
+
 
 vfprintf=
 doprint=
@@ -2334,17 +4768,21 @@
 
 
 
-echo $ac_n "checking whether the printf functions support %p""... $ac_c" 1>&6
-echo "configure:2339: checking whether the printf functions support %p" >&5
-if eval "test \"`echo '$''{'gcc_cv_func_printf_ptr'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking whether the printf functions support %p" >&5
+echo $ECHO_N "checking whether the printf functions support %p... $ECHO_C" >&6
+if test "${gcc_cv_func_printf_ptr+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test "$cross_compiling" = yes; then
   gcc_cv_func_printf_ptr=no
 else
-  cat > conftest.$ac_ext <<EOF
-#line 2347 "configure"
-#include "confdefs.h"
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <stdio.h>
 
 main()
@@ -2355,186 +4793,441 @@
   sscanf(buf, "%p", &q);
   exit (p != q);
 }
-EOF
-if { (eval echo configure:2360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   gcc_cv_func_printf_ptr=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  gcc_cv_func_printf_ptr=no
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+gcc_cv_func_printf_ptr=no
 fi
-rm -fr conftest*
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-
 rm -f core core.* *.core
 fi
-
-echo "$ac_t""$gcc_cv_func_printf_ptr" 1>&6
+echo "$as_me:$LINENO: result: $gcc_cv_func_printf_ptr" >&5
+echo "${ECHO_T}$gcc_cv_func_printf_ptr" >&6
 if test $gcc_cv_func_printf_ptr = yes ; then
-  cat >> confdefs.h <<\EOF
+  cat >>confdefs.h <<\_ACEOF
 #define HAVE_PRINTF_PTR 1
-EOF
+_ACEOF
 
 fi
 
 
 case "${host}" in
 *-*-uwin*)
-  { echo "configure: error: 
+  { { echo "$as_me:$LINENO: error:
 *** UWIN may not be used as a host platform because
-*** linking with posix.dll is not allowed by the GNU GPL" 1>&2; exit 1; }
+*** linking with posix.dll is not allowed by the GNU GPL" >&5
+echo "$as_me: error:
+*** UWIN may not be used as a host platform because
+*** linking with posix.dll is not allowed by the GNU GPL" >&2;}
+   { (exit 1); exit 1; }; }
   ;;
 esac
-echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:2392: checking for pid_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 2397 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
-  rm -rf conftest*
+echo "$as_me:$LINENO: checking for pid_t" >&5
+echo $ECHO_N "checking for pid_t... $ECHO_C" >&6
+if test "${ac_cv_type_pid_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if ((pid_t *) 0)
+  return 0;
+if (sizeof (pid_t))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_type_pid_t=yes
 else
-  rm -rf conftest*
-  ac_cv_type_pid_t=no
-fi
-rm -f conftest*
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+ac_cv_type_pid_t=no
 fi
-echo "$ac_t""$ac_cv_type_pid_t" 1>&6
-if test $ac_cv_type_pid_t = no; then
-  cat >> confdefs.h <<\EOF
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
+echo "${ECHO_T}$ac_cv_type_pid_t" >&6
+if test $ac_cv_type_pid_t = yes; then
+  :
+else
+
+cat >>confdefs.h <<_ACEOF
 #define pid_t int
-EOF
+_ACEOF
 
 fi
 
-ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:2426: checking for vfork.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 2431 "configure"
-#include "confdefs.h"
-#include <vfork.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2436: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+
+
+for ac_header in unistd.h vfork.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+  yes:no )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+  no:yes )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=$ac_header_preproc"
 fi
-rm -f conftest*
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  cat >> confdefs.h <<\EOF
-#define HAVE_VFORK_H 1
-EOF
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
 
-else
-  echo "$ac_t""no" 1>&6
 fi
 
-echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:2461: checking for working vfork" >&5
-if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  if test "$cross_compiling" = yes; then
-  echo $ac_n "checking for vfork""... $ac_c" 1>&6
-echo "configure:2467: checking for vfork" >&5
-if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 2472 "configure"
-#include "confdefs.h"
+done
+
+
+
+for ac_func in fork vfork
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char vfork(); below.  */
-#include <assert.h>
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char vfork();
-
-int main() {
-
+char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_vfork) || defined (__stub___vfork)
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-vfork();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
 #endif
 
-; return 0; }
-EOF
-if { (eval echo configure:2495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_vfork=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_vfork=no"
-fi
-rm -f conftest*
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
 fi
+done
 
-if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  :
+if test "x$ac_cv_func_fork" = xyes; then
+  echo "$as_me:$LINENO: checking for working fork" >&5
+echo $ECHO_N "checking for working fork... $ECHO_C" >&6
+if test "${ac_cv_func_fork_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$cross_compiling" = yes; then
+  ac_cv_func_fork_works=cross
 else
-  echo "$ac_t""no" 1>&6
+  cat >conftest.$ac_ext <<_ACEOF
+/* By Ruediger Kuhlmann. */
+      #include <sys/types.h>
+      #if HAVE_UNISTD_H
+      # include <unistd.h>
+      #endif
+      /* Some systems only have a dummy stub for fork() */
+      int main ()
+      {
+        if (fork() < 0)
+          exit (1);
+        exit (0);
+      }
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_fork_works=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_fork_works=no
+fi
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5
+echo "${ECHO_T}$ac_cv_func_fork_works" >&6
+
+else
+  ac_cv_func_fork_works=$ac_cv_func_fork
+fi
+if test "x$ac_cv_func_fork_works" = xcross; then
+  case $host in
+    *-*-amigaos* | *-*-msdosdjgpp*)
+      # Override, as these systems have only a dummy fork() stub
+      ac_cv_func_fork_works=no
+      ;;
+    *)
+      ac_cv_func_fork_works=yes
+      ;;
+  esac
+  { echo "$as_me:$LINENO: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5
+echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;}
 fi
-
 ac_cv_func_vfork_works=$ac_cv_func_vfork
+if test "x$ac_cv_func_vfork" = xyes; then
+  echo "$as_me:$LINENO: checking for working vfork" >&5
+echo $ECHO_N "checking for working vfork... $ECHO_C" >&6
+if test "${ac_cv_func_vfork_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 2517 "configure"
-#include "confdefs.h"
+  if test "$cross_compiling" = yes; then
+  ac_cv_func_vfork_works=cross
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 /* Thanks to Paul Eggert for this test.  */
 #include <stdio.h>
+#include <stdlib.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
+#include <sys/wait.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
 #endif
-#ifdef HAVE_VFORK_H
-#include <vfork.h>
+#if HAVE_VFORK_H
+# include <vfork.h>
 #endif
 /* On some sparc systems, changes by the child to local and incoming
-   argument registers are propagated back to the parent.
-   The compiler is told about this with #include <vfork.h>,
-   but some compilers (e.g. gcc -O) don't grok <vfork.h>.
-   Test for this by using a static variable whose address
-   is put into a register that is clobbered by the vfork.  */
-static
+   argument registers are propagated back to the parent.  The compiler
+   is told about this with #include <vfork.h>, but some compilers
+   (e.g. gcc -O) don't grok <vfork.h>.  Test for this by using a
+   static variable whose address is put into a register that is
+   clobbered by the vfork.  */
+static void
 #ifdef __cplusplus
 sparc_address_test (int arg)
-#else
+# else
 sparc_address_test (arg) int arg;
 #endif
 {
@@ -2552,25 +5245,27 @@
     }
   }
 }
-main() {
-  pid_t parent = getpid ();
-  pid_t child;
-
-  sparc_address_test ();
+
+int
+main ()
+{
+  pid_t parent = getpid ();
+  pid_t child;
+
+  sparc_address_test (0);
 
   child = vfork ();
 
   if (child == 0) {
-    /* Here is another test for sparc vfork register problems.
-       This test uses lots of local variables, at least
-       as many local variables as main has allocated so far
-       including compiler temporaries.  4 locals are enough for
-       gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
-       A buggy compiler should reuse the register of parent
-       for one of the local variables, since it will think that
-       parent can't possibly be used any more in this routine.
-       Assigning to the local variable will thus munge parent
-       in the parent process.  */
+    /* Here is another test for sparc vfork register problems.  This
+       test uses lots of local variables, at least as many local
+       variables as main has allocated so far including compiler
+       temporaries.  4 locals are enough for gcc 1.40.3 on a Solaris
+       4.1.3 sparc, but we use 8 to be safe.  A buggy compiler should
+       reuse the register of parent for one of the local variables,
+       since it will think that parent can't possibly be used any more
+       in this routine.  Assigning to the local variable will thus
+       munge parent in the parent process.  */
     pid_t
       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
@@ -2580,11 +5275,10 @@
 	|| p != p5 || p != p6 || p != p7)
       _exit(1);
 
-    /* On some systems (e.g. IRIX 3.3),
-       vfork doesn't separate parent from child file descriptors.
-       If the child closes a descriptor before it execs or exits,
-       this munges the parent's descriptor as well.
-       Test for this by closing stdout in the child.  */
+    /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
+       from child file descriptors.  If the child closes a descriptor
+       before it execs or exits, this munges the parent's descriptor
+       as well.  Test for this by closing stdout in the child.  */
     _exit(close(fileno(stdout)) != 0);
   } else {
     int status;
@@ -2607,26 +5301,58 @@
 	 );
   }
 }
-EOF
-if { (eval echo configure:2612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_func_vfork_works=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_func_vfork_works=no
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_vfork_works=no
 fi
-rm -fr conftest*
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5
+echo "${ECHO_T}$ac_cv_func_vfork_works" >&6
 
+fi;
+if test "x$ac_cv_func_fork_works" = xcross; then
+  ac_cv_func_vfork_works=ac_cv_func_vfork
+  { echo "$as_me:$LINENO: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5
+echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;}
 fi
 
-echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
-if test $ac_cv_func_vfork_works = no; then
-  cat >> confdefs.h <<\EOF
+if test "x$ac_cv_func_vfork_works" = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_WORKING_VFORK 1
+_ACEOF
+
+else
+
+cat >>confdefs.h <<\_ACEOF
 #define vfork fork
-EOF
+_ACEOF
+
+fi
+if test "x$ac_cv_func_fork_works" = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_WORKING_FORK 1
+_ACEOF
 
 fi
 
@@ -2635,14 +5361,18 @@
 	index rindex getenv atol sbrk abort atof strerror getcwd getwd \
 	strsignal putc_unlocked fputs_unlocked strstr
 do
-echo $ac_n "checking whether $ac_func must be declared""... $ac_c" 1>&6
-echo "configure:2640: checking whether $ac_func must be declared" >&5
-if eval "test \"`echo '$''{'gcc_cv_decl_needed_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 2645 "configure"
-#include "confdefs.h"
+echo "$as_me:$LINENO: checking whether $ac_func must be declared" >&5
+echo $ECHO_N "checking whether $ac_func must be declared... $ECHO_C" >&6
+if eval "test \"\${gcc_cv_decl_needed_$ac_func+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 #include <stdio.h>
 #ifdef STRING_WITH_STRINGS
@@ -2670,31 +5400,47 @@
 #define index strchr
 #endif
 
-int main() {
+int
+main ()
+{
 char *(*pfn) = (char *(*)) $ac_func
-; return 0; }
-EOF
-if { (eval echo configure:2678: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   eval "gcc_cv_decl_needed_$ac_func=no"
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "gcc_cv_decl_needed_$ac_func=yes"
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "gcc_cv_decl_needed_$ac_func=yes"
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 fi
 
 if eval "test \"`echo '$gcc_cv_decl_needed_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
   gcc_tr_decl=NEED_DECLARATION_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
+  cat >>confdefs.h <<_ACEOF
 #define $gcc_tr_decl 1
-EOF
+_ACEOF
 
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
 done
@@ -2702,14 +5448,18 @@
 
 for ac_func in getrlimit setrlimit
 do
-echo $ac_n "checking whether $ac_func must be declared""... $ac_c" 1>&6
-echo "configure:2707: checking whether $ac_func must be declared" >&5
-if eval "test \"`echo '$''{'gcc_cv_decl_needed_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 2712 "configure"
-#include "confdefs.h"
+echo "$as_me:$LINENO: checking whether $ac_func must be declared" >&5
+echo $ECHO_N "checking whether $ac_func must be declared... $ECHO_C" >&6
+if eval "test \"\${gcc_cv_decl_needed_$ac_func+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 #include <stdio.h>
 #ifdef STRING_WITH_STRINGS
@@ -2741,71 +5491,111 @@
 #include <sys/resource.h>
 #endif
 
-int main() {
+int
+main ()
+{
 char *(*pfn) = (char *(*)) $ac_func
-; return 0; }
-EOF
-if { (eval echo configure:2749: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   eval "gcc_cv_decl_needed_$ac_func=no"
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "gcc_cv_decl_needed_$ac_func=yes"
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "gcc_cv_decl_needed_$ac_func=yes"
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 fi
 
 if eval "test \"`echo '$gcc_cv_decl_needed_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
   gcc_tr_decl=NEED_DECLARATION_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
+  cat >>confdefs.h <<_ACEOF
 #define $gcc_tr_decl 1
-EOF
+_ACEOF
 
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
 done
 
 
-echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
-echo "configure:2776: checking for sys_siglist declaration in signal.h or unistd.h" >&5
-if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 2781 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <signal.h>
-/* NetBSD declares sys_siglist in unistd.h.  */
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
+echo "$as_me:$LINENO: checking whether sys_siglist is declared" >&5
+echo $ECHO_N "checking whether sys_siglist is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_sys_siglist+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef sys_siglist
+  char *p = (char *) sys_siglist;
 #endif
-int main() {
-char *msg = *(sys_siglist + 1);
-; return 0; }
-EOF
-if { (eval echo configure:2793: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ac_cv_decl_sys_siglist=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_decl_sys_siglist=no
-fi
-rm -f conftest*
-fi
 
-echo "$ac_t""$ac_cv_decl_sys_siglist" 1>&6
-if test $ac_cv_decl_sys_siglist = yes; then
-  cat >> confdefs.h <<\EOF
-#define SYS_SIGLIST_DECLARED 1
-EOF
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_have_decl_sys_siglist=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_have_decl_sys_siglist=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_sys_siglist" >&5
+echo "${ECHO_T}$ac_cv_have_decl_sys_siglist" >&6
+if test $ac_cv_have_decl_sys_siglist = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SYS_SIGLIST 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SYS_SIGLIST 0
+_ACEOF
+
 
 fi
 
@@ -2810,15 +5600,21 @@
 fi
 
 
+
+
 # mkdir takes a single argument on some systems. 
-echo $ac_n "checking if mkdir takes one argument""... $ac_c" 1>&6
-echo "configure:2816: checking if mkdir takes one argument" >&5
-if eval "test \"`echo '$''{'gcc_cv_mkdir_takes_one_arg'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 2821 "configure"
-#include "confdefs.h"
+echo "$as_me:$LINENO: checking if mkdir takes one argument" >&5
+echo $ECHO_N "checking if mkdir takes one argument... $ECHO_C" >&6
+if test "${gcc_cv_mkdir_takes_one_arg+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 #include <sys/types.h>
 #ifdef HAVE_SYS_STAT_H
@@ -2830,27 +5626,41 @@
 #ifdef HAVE_DIRECT_H
 # include <direct.h>
 #endif
-int main() {
+int
+main ()
+{
 mkdir ("foo", 0);
-; return 0; }
-EOF
-if { (eval echo configure:2838: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   gcc_cv_mkdir_takes_one_arg=no
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  gcc_cv_mkdir_takes_one_arg=yes
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+gcc_cv_mkdir_takes_one_arg=yes
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-
-echo "$ac_t""$gcc_cv_mkdir_takes_one_arg" 1>&6
+echo "$as_me:$LINENO: result: $gcc_cv_mkdir_takes_one_arg" >&5
+echo "${ECHO_T}$gcc_cv_mkdir_takes_one_arg" >&6
 if test $gcc_cv_mkdir_takes_one_arg = yes ; then
-  cat >> confdefs.h <<\EOF
+  cat >>confdefs.h <<\_ACEOF
 #define MKDIR_TAKES_ONE_ARG 1
-EOF
+_ACEOF
 
 fi
 
@@ -3498,6 +6308,22 @@
 			thread_file='mach'
 		fi
 		;;
+        i[34567]86-*-macosx* | \
+        i[34567]86-*-darwin*)
+      		out_file=i386/openstep.c
+      		xm_file=i386/xm-openstep.h
+		xm_defines="SYS_SIGLIST_DECLARED"
+      		tm_file=i386/openstep.h
+      		tmake_file=apple/t-apple
+      		xmake_file=apple/x-darwin
+      		extra_objs=machopic.o
+      		extra_passes=cc1obj
+      		fixincludes=Makefile.in # On NeXT, the headers are ok already.
+      		if  x$enable_threads = xyes ; then
+              		thread_file='mach'
+      		fi
+      		makefile_cond="$makefile_cond next-headers"
+      		;;
 	i[34567]86-sequent-bsd*) 		# 80386 from Sequent
 		use_collect2=yes
 		if test x$gas = xyes
@@ -4446,6 +7272,14 @@
 		extra_headers=math-68881.h
 		float_format=m68k
 		;;
+	m68k-*-amigaos*)
+                xm_file=m68k/xm-amigaos.h
+                tm_file=m68k/amigaos.h
+                tmake_file=m68k/t-amigaos
+                xmake_file=m68k/x-amigaos
+                extra_objs=amigaos.o
+                gnu_ld=yes
+                ;;
 
 	m88k-dg-dgux*)
 		case $machine in
@@ -5069,6 +7903,15 @@
 	romp-*-openbsd*)
 		# Nothing special
 		;;
+	powerpc-*-amiga*)
+		cpu_type=rs6000
+		tm_file=rs6000/amigaos.h
+		xm_file=rs6000/xm-amigaos.h
+		tmake_file=rs6000/t-amigaos
+		xmake_file=rs6000/x-amigaos
+		extra_objs=amigaos.o
+        use_collect2=yes
+		;;
 	powerpc-*-openbsd*)
 		tmake_file="${tmake_file} rs6000/t-rs6000 rs6000/t-openbsd"
 		;;
@@ -5157,6 +8000,25 @@
 			thread_file='posix'
 		fi
 		;;
+	powerpc-*-macosx* | powerpc-*-darwin*)
+     	 	cpu_type=rs6000
+      		tm_file=rs6000/macosx.h
+      		out_file=rs6000/macosx.c
+      		xm_file=rs6000/xm-macosx.h
+		xm_defines="SYS_SIGLIST_DECLARED"
+      		tmake_file=rs6000/t-macosx
+      		xmake_file=apple/x-darwin
+      		extra_objs=machopic.o
+      		extra_passes=cc1obj
+      		fixincludes=Makefile.in # On NeXT, the headers are ok already.
+      		makefile_conf="$makefile_cond next-headers"
+      		;;
+   	powerpc-*-macos*)
+      		out_file=rs6000/macos.c
+      		tm_file=rs6000/macos.h
+      		tmake_file=rs6000/t-macos
+      		fixincludes=Makefile.in
+      		;;
         powerpc-wrs-vxworks*)
                 cpu_type=rs6000
 		xm_file="xm-siglist.h rs6000/xm-sysv4.h"
@@ -6037,13 +8899,13 @@
 # Internationalization
 PACKAGE=gcc
 VERSION="$gcc_version"
-cat >> confdefs.h <<EOF
+cat >>confdefs.h <<_ACEOF
 #define PACKAGE "$PACKAGE"
-EOF
+_ACEOF
 
-cat >> confdefs.h <<EOF
+cat >>confdefs.h <<_ACEOF
 #define VERSION "$VERSION"
-EOF
+_ACEOF
 
 
 
@@ -6054,280 +8916,408 @@
 # Check whether --enable-nls or --disable-nls was given.
 if test "${enable_nls+set}" = set; then
   enableval="$enable_nls"
-  :
+
 else
   enable_nls=no
-fi
+fi;
 
 
-
-        echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6
-echo "configure:6066: checking for strerror in -lcposix" >&5
-ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+        echo "$as_me:$LINENO: checking for strerror in -lcposix" >&5
+echo $ECHO_N "checking for strerror in -lcposix... $ECHO_C" >&6
+if test "${ac_cv_lib_cposix_strerror+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lcposix  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 6074 "configure"
-#include "confdefs.h"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char strerror();
-
-int main() {
-strerror()
-; return 0; }
-EOF
-if { (eval echo configure:6085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+char strerror ();
+int
+main ()
+{
+strerror ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_cposix_strerror=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_cposix_strerror=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_cposix_strerror" >&5
+echo "${ECHO_T}$ac_cv_lib_cposix_strerror" >&6
+if test $ac_cv_lib_cposix_strerror = yes; then
   LIBS="$LIBS -lcposix"
-else
-  echo "$ac_t""no" 1>&6
 fi
 
   
 
-echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:6108: checking for working const" >&5
-if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6113 "configure"
-#include "confdefs.h"
-
-int main() {
-
-/* Ultrix mips cc rejects this.  */
-typedef int charset[2]; const charset x;
-/* SunOS 4.1.1 cc rejects this.  */
-char const *const *ccp;
-char **p;
-/* NEC SVR4.0.2 mips cc rejects this.  */
-struct point {int x, y;};
-static struct point const zero = {0,0};
-/* AIX XL C 1.02.0.0 rejects this.
-   It does not let you subtract one const X* pointer from another in an arm
-   of an if-expression whose if-part is not a constant expression */
-const char *g = "string";
-ccp = &g + (g ? g-g : 0);
-/* HPUX 7.0 cc rejects these. */
-++ccp;
-p = (char**) ccp;
-ccp = (char const *const *) p;
-{ /* SCO 3.2v4 cc rejects this.  */
+echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
+echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
+if test "${ac_cv_c_const+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+  /* Ultrix mips cc rejects this.  */
+  typedef int charset[2];
+  const charset x;
+  /* SunOS 4.1.1 cc rejects this.  */
+  char const *const *ccp;
+  char **p;
+  /* NEC SVR4.0.2 mips cc rejects this.  */
+  struct point {int x, y;};
+  static struct point const zero = {0,0};
+  /* AIX XL C 1.02.0.0 rejects this.
+     It does not let you subtract one const X* pointer from another in
+     an arm of an if-expression whose if-part is not a constant
+     expression */
+  const char *g = "string";
+  ccp = &g + (g ? g-g : 0);
+  /* HPUX 7.0 cc rejects these. */
+  ++ccp;
+  p = (char**) ccp;
+  ccp = (char const *const *) p;
+  { /* SCO 3.2v4 cc rejects this.  */
   char *t;
   char const *s = 0 ? (char *) 0 : (char const *) 0;
 
   *t++ = 0;
-}
-{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
+  }
+  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
   int x[] = {25, 17};
   const int *foo = &x[0];
   ++foo;
-}
-{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+  }
+  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
   typedef const int *iptr;
   iptr p = 0;
   ++p;
-}
-{ /* AIX XL C 1.02.0.0 rejects this saying
+  }
+  { /* AIX XL C 1.02.0.0 rejects this saying
      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
   struct s { int j; const int *ap[3]; };
   struct s *b; b->j = 5;
-}
-{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+  }
+  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
   const int foo = 10;
-}
+  }
+#endif
 
-; return 0; }
-EOF
-if { (eval echo configure:6162: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_c_const=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_c_const=no
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_c_const=no
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-
-echo "$ac_t""$ac_cv_c_const" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+echo "${ECHO_T}$ac_cv_c_const" >&6
 if test $ac_cv_c_const = no; then
-  cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
 #define const 
-EOF
+_ACEOF
 
 fi
 
-echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:6183: checking for inline" >&5
-if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for inline" >&5
+echo $ECHO_N "checking for inline... $ECHO_C" >&6
+if test "${ac_cv_c_inline+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
-  cat > conftest.$ac_ext <<EOF
-#line 6190 "configure"
-#include "confdefs.h"
-
-int main() {
-} $ac_kw foo() {
-; return 0; }
-EOF
-if { (eval echo configure:6197: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_c_inline=$ac_kw; break
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-
-echo "$ac_t""$ac_cv_c_inline" 1>&6
-case "$ac_cv_c_inline" in
+echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
+echo "${ECHO_T}$ac_cv_c_inline" >&6
+case $ac_cv_c_inline in
   inline | yes) ;;
-  no) cat >> confdefs.h <<\EOF
+  no)
+cat >>confdefs.h <<\_ACEOF
 #define inline 
-EOF
+_ACEOF
  ;;
-  *)  cat >> confdefs.h <<EOF
+  *)  cat >>confdefs.h <<_ACEOF
 #define inline $ac_cv_c_inline
-EOF
+_ACEOF
  ;;
 esac
 
-echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:6223: checking for off_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6228 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
-  rm -rf conftest*
+echo "$as_me:$LINENO: checking for off_t" >&5
+echo $ECHO_N "checking for off_t... $ECHO_C" >&6
+if test "${ac_cv_type_off_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if ((off_t *) 0)
+  return 0;
+if (sizeof (off_t))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_type_off_t=yes
 else
-  rm -rf conftest*
-  ac_cv_type_off_t=no
-fi
-rm -f conftest*
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+ac_cv_type_off_t=no
 fi
-echo "$ac_t""$ac_cv_type_off_t" 1>&6
-if test $ac_cv_type_off_t = no; then
-  cat >> confdefs.h <<\EOF
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
+echo "${ECHO_T}$ac_cv_type_off_t" >&6
+if test $ac_cv_type_off_t = yes; then
+  :
+else
+
+cat >>confdefs.h <<_ACEOF
 #define off_t long
-EOF
+_ACEOF
 
 fi
 
-echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:6256: checking for size_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6261 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
-  rm -rf conftest*
+echo "$as_me:$LINENO: checking for size_t" >&5
+echo $ECHO_N "checking for size_t... $ECHO_C" >&6
+if test "${ac_cv_type_size_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if ((size_t *) 0)
+  return 0;
+if (sizeof (size_t))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_type_size_t=yes
 else
-  rm -rf conftest*
-  ac_cv_type_size_t=no
-fi
-rm -f conftest*
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+ac_cv_type_size_t=no
 fi
-echo "$ac_t""$ac_cv_type_size_t" 1>&6
-if test $ac_cv_type_size_t = no; then
-  cat >> confdefs.h <<\EOF
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+echo "${ECHO_T}$ac_cv_type_size_t" >&6
+if test $ac_cv_type_size_t = yes; then
+  :
+else
+
+cat >>confdefs.h <<_ACEOF
 #define size_t unsigned
-EOF
+_ACEOF
 
 fi
 
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
-echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:6291: checking for working alloca.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6296 "configure"
-#include "confdefs.h"
+echo "$as_me:$LINENO: checking for working alloca.h" >&5
+echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6
+if test "${ac_cv_working_alloca_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <alloca.h>
-int main() {
-char *p = alloca(2 * sizeof(int));
-; return 0; }
-EOF
-if { (eval echo configure:6303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  ac_cv_header_alloca_h=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_header_alloca_h=no
-fi
-rm -f conftest*
-fi
+int
+main ()
+{
+char *p = (char *) alloca (2 * sizeof (int));
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_working_alloca_h=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_working_alloca_h=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5
+echo "${ECHO_T}$ac_cv_working_alloca_h" >&6
+if test $ac_cv_working_alloca_h = yes; then
 
-echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
-if test $ac_cv_header_alloca_h = yes; then
-  cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\_ACEOF
 #define HAVE_ALLOCA_H 1
-EOF
+_ACEOF
 
 fi
 
-echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:6324: checking for alloca" >&5
-if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6329 "configure"
-#include "confdefs.h"
-
+echo "$as_me:$LINENO: checking for alloca" >&5
+echo $ECHO_N "checking for alloca... $ECHO_C" >&6
+if test "${ac_cv_func_alloca_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #ifdef __GNUC__
 # define alloca __builtin_alloca
 #else
@@ -6349,137 +9339,190 @@
 # endif
 #endif
 
-int main() {
-char *p = (char *) alloca(1);
-; return 0; }
-EOF
-if { (eval echo configure:6357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+int
+main ()
+{
+char *p = (char *) alloca (1);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_func_alloca_works=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_func_alloca_works=no
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_alloca_works=no
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
+echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5
+echo "${ECHO_T}$ac_cv_func_alloca_works" >&6
 
-echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
 if test $ac_cv_func_alloca_works = yes; then
-  cat >> confdefs.h <<\EOF
-#define HAVE_ALLOCA 1
-EOF
 
-fi
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ALLOCA 1
+_ACEOF
 
-if test $ac_cv_func_alloca_works = no; then
+else
   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
-  # that cause trouble.  Some versions do not even contain alloca or
-  # contain a buggy version.  If you still want to use their alloca,
-  # use ar to extract alloca.o from them instead of compiling alloca.c.
-  ALLOCA=alloca.${ac_objext}
-  cat >> confdefs.h <<\EOF
+# that cause trouble.  Some versions do not even contain alloca or
+# contain a buggy version.  If you still want to use their alloca,
+# use ar to extract alloca.o from them instead of compiling alloca.c.
+
+ALLOCA=alloca.$ac_objext
+
+cat >>confdefs.h <<\_ACEOF
 #define C_ALLOCA 1
-EOF
+_ACEOF
 
 
-echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:6389: checking whether alloca needs Cray hooks" >&5
-if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6394 "configure"
-#include "confdefs.h"
+echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5
+echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6
+if test "${ac_cv_os_cray+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
 #else
 wenotbecray
 #endif
 
-EOF
+_ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "webecray" >/dev/null 2>&1; then
-  rm -rf conftest*
+  $EGREP "webecray" >/dev/null 2>&1; then
   ac_cv_os_cray=yes
 else
-  rm -rf conftest*
   ac_cv_os_cray=no
 fi
 rm -f conftest*
 
 fi
-
-echo "$ac_t""$ac_cv_os_cray" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5
+echo "${ECHO_T}$ac_cv_os_cray" >&6
 if test $ac_cv_os_cray = yes; then
-for ac_func in _getb67 GETB67 getb67; do
-  echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6419: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6424 "configure"
-#include "confdefs.h"
+  for ac_func in _getb67 GETB67 getb67; do
+    as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
-#include <assert.h>
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
-int main() {
-
+char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
 #endif
 
-; return 0; }
-EOF
-if { (eval echo configure:6447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  cat >> confdefs.h <<EOF
+cat >>confdefs.h <<_ACEOF
 #define CRAY_STACKSEG_END $ac_func
-EOF
+_ACEOF
 
   break
-else
-  echo "$ac_t""no" 1>&6
 fi
 
-done
+  done
 fi
 
-echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:6474: checking stack direction for C alloca" >&5
-if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking stack direction for C alloca" >&5
+echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6
+if test "${ac_cv_c_stack_direction+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test "$cross_compiling" = yes; then
   ac_cv_c_stack_direction=0
 else
-  cat > conftest.$ac_ext <<EOF
-#line 6482 "configure"
-#include "confdefs.h"
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+int
 find_stack_direction ()
 {
   static char *addr = 0;
@@ -6492,138 +9535,291 @@
   else
     return (&dummy > addr) ? 1 : -1;
 }
+
+int
 main ()
 {
-  exit (find_stack_direction() < 0);
+  exit (find_stack_direction () < 0);
 }
-EOF
-if { (eval echo configure:6501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_c_stack_direction=1
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_c_stack_direction=-1
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_c_stack_direction=-1
 fi
-rm -fr conftest*
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-
 fi
+echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5
+echo "${ECHO_T}$ac_cv_c_stack_direction" >&6
 
-echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
-cat >> confdefs.h <<EOF
+cat >>confdefs.h <<_ACEOF
 #define STACK_DIRECTION $ac_cv_c_stack_direction
-EOF
+_ACEOF
+
 
 fi
 
-for ac_hdr in unistd.h
+
+
+for ac_header in stdlib.h unistd.h
 do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6526: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6531 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6536: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+  yes:no )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+  no:yes )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=$ac_header_preproc"
 fi
-rm -f conftest*
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
  
-else
-  echo "$ac_t""no" 1>&6
 fi
+
 done
 
+
 for ac_func in getpagesize
 do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6565: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6570 "configure"
-#include "confdefs.h"
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
-#include <assert.h>
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
-int main() {
-
+char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
 #endif
 
-; return 0; }
-EOF
-if { (eval echo configure:6593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
- 
-else
-  echo "$ac_t""no" 1>&6
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+ 
 fi
 done
 
-echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:6618: checking for working mmap" >&5
-if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for working mmap" >&5
+echo $ECHO_N "checking for working mmap... $ECHO_C" >&6
+if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test "$cross_compiling" = yes; then
   ac_cv_func_mmap_fixed_mapped=no
 else
-  cat > conftest.$ac_ext <<EOF
-#line 6626 "configure"
-#include "confdefs.h"
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+/* malloc might have been renamed as rpl_malloc. */
+#undef malloc
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
    Here is a matrix of mmap possibilities:
@@ -6637,34 +9833,34 @@
    back from the file, nor mmap's back from the file at a different
    address.  (There have been systems where private was not correctly
    implemented like the infamous i386 svr4.0, and systems where the
-   VM page cache was not coherent with the filesystem buffer cache
+   VM page cache was not coherent with the file system buffer cache
    like early versions of FreeBSD and possibly contemporary NetBSD.)
    For shared mappings, we should conversely verify that changes get
-   propogated back to all the places they're supposed to be.
+   propagated back to all the places they're supposed to be.
 
    Grep wants private fixed already mapped.
    The main things grep needs to know about mmap are:
    * does it exist and is it safe to write into the mmap'd area
    * how to use it (BSD variants)  */
-#include <sys/types.h>
+
 #include <fcntl.h>
 #include <sys/mman.h>
 
-/* This mess was copied from the GNU getpagesize.h.  */
-#ifndef HAVE_GETPAGESIZE
-# ifdef HAVE_UNISTD_H
-#  include <unistd.h>
-# endif
+#if !STDC_HEADERS && !HAVE_STDLIB_H
+char *malloc ();
+#endif
 
+/* This mess was copied from the GNU getpagesize.h.  */
+#if !HAVE_GETPAGESIZE
 /* Assume that all systems that can run configure have sys/param.h.  */
-# ifndef HAVE_SYS_PARAM_H
+# if !HAVE_SYS_PARAM_H
 #  define HAVE_SYS_PARAM_H 1
 # endif
 
 # ifdef _SC_PAGESIZE
 #  define getpagesize() sysconf(_SC_PAGESIZE)
 # else /* no _SC_PAGESIZE */
-#  ifdef HAVE_SYS_PARAM_H
+#  if HAVE_SYS_PARAM_H
 #   include <sys/param.h>
 #   ifdef EXEC_PAGESIZE
 #    define getpagesize() EXEC_PAGESIZE
@@ -6691,327 +9887,521 @@
 
 #endif /* no HAVE_GETPAGESIZE */
 
-#ifdef __cplusplus
-extern "C" { void *malloc(unsigned); }
-#else
-char *malloc();
-#endif
-
 int
-main()
+main ()
 {
 	char *data, *data2, *data3;
 	int i, pagesize;
 	int fd;
 
-	pagesize = getpagesize();
+  pagesize = getpagesize ();
 
-	/*
-	 * First, make a file with some known garbage in it.
-	 */
-	data = malloc(pagesize);
+  /* First, make a file with some known garbage in it. */
+  data = (char *) malloc (pagesize);
 	if (!data)
-		exit(1);
+    exit (1);
 	for (i = 0; i < pagesize; ++i)
-		*(data + i) = rand();
-	umask(0);
-	fd = creat("conftestmmap", 0600);
+    *(data + i) = rand ();
+  umask (0);
+  fd = creat ("conftest.mmap", 0600);
 	if (fd < 0)
-		exit(1);
-	if (write(fd, data, pagesize) != pagesize)
-		exit(1);
-	close(fd);
-
-	/*
-	 * Next, try to mmap the file at a fixed address which
-	 * already has something else allocated at it.  If we can,
-	 * also make sure that we see the same garbage.
-	 */
-	fd = open("conftestmmap", O_RDWR);
+    exit (1);
+  if (write (fd, data, pagesize) != pagesize)
+    exit (1);
+  close (fd);
+
+  /* Next, try to mmap the file at a fixed address which already has
+     something else allocated at it.  If we can, also make sure that
+     we see the same garbage.  */
+  fd = open ("conftest.mmap", O_RDWR);
 	if (fd < 0)
-		exit(1);
-	data2 = malloc(2 * pagesize);
+    exit (1);
+  data2 = (char *) malloc (2 * pagesize);
 	if (!data2)
-		exit(1);
+    exit (1);
 	data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
-	if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
+  if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
 	    MAP_PRIVATE | MAP_FIXED, fd, 0L))
-		exit(1);
+    exit (1);
 	for (i = 0; i < pagesize; ++i)
 		if (*(data + i) != *(data2 + i))
-			exit(1);
+      exit (1);
 
-	/*
-	 * Finally, make sure that changes to the mapped area
-	 * do not percolate back to the file as seen by read().
-	 * (This is a bug on some variants of i386 svr4.0.)
-	 */
+  /* Finally, make sure that changes to the mapped area do not
+     percolate back to the file as seen by read().  (This is a bug on
+     some variants of i386 svr4.0.)  */
 	for (i = 0; i < pagesize; ++i)
 		*(data2 + i) = *(data2 + i) + 1;
-	data3 = malloc(pagesize);
+  data3 = (char *) malloc (pagesize);
 	if (!data3)
-		exit(1);
-	if (read(fd, data3, pagesize) != pagesize)
-		exit(1);
+    exit (1);
+  if (read (fd, data3, pagesize) != pagesize)
+    exit (1);
 	for (i = 0; i < pagesize; ++i)
 		if (*(data + i) != *(data3 + i))
-			exit(1);
-	close(fd);
-	unlink("conftestmmap");
-	exit(0);
+      exit (1);
+  close (fd);
+  exit (0);
 }
-
-EOF
-if { (eval echo configure:6766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_func_mmap_fixed_mapped=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_func_mmap_fixed_mapped=no
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_mmap_fixed_mapped=no
 fi
-rm -fr conftest*
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-
 fi
-
-echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5
+echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6
 if test $ac_cv_func_mmap_fixed_mapped = yes; then
-  cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
 #define HAVE_MMAP 1
-EOF
+_ACEOF
 
 fi
+rm -f conftest.mmap
+
+
+
+
 
                               
-   for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.h string.h \
+
+
+
+
+for ac_header in argz.h limits.h locale.h nl_types.h malloc.h string.h \
 unistd.h sys/param.h
 do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6794: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6799 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6804: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+  yes:no )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+  no:yes )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=$ac_header_preproc"
 fi
-rm -f conftest*
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
  
-else
-  echo "$ac_t""no" 1>&6
 fi
+
 done
 
-   for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \
+
+
+
+
+
+
+
+
+
+
+
+for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \
 strdup __argz_count __argz_stringify __argz_next
 do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6834: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6839 "configure"
-#include "confdefs.h"
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
-#include <assert.h>
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
-int main() {
-
+char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
 #endif
 
-; return 0; }
-EOF
-if { (eval echo configure:6862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
  
-else
-  echo "$ac_t""no" 1>&6
 fi
 done
 
 
    if test "${ac_cv_func_stpcpy+set}" != "set"; then
-     for ac_func in stpcpy
+
+for ac_func in stpcpy
 do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6891: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6896 "configure"
-#include "confdefs.h"
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
-#include <assert.h>
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
-int main() {
-
+char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
 #endif
 
-; return 0; }
-EOF
-if { (eval echo configure:6919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
  
-else
-  echo "$ac_t""no" 1>&6
 fi
 done
 
    fi
    if test "${ac_cv_func_stpcpy}" = "yes"; then
-     cat >> confdefs.h <<\EOF
+     cat >>confdefs.h <<\_ACEOF
 #define HAVE_STPCPY 1
-EOF
+_ACEOF
 
    fi
 
    if test $ac_cv_header_locale_h = yes; then
-    echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:6953: checking for LC_MESSAGES" >&5
-if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6958 "configure"
-#include "confdefs.h"
+    echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5
+echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6
+if test "${am_cv_val_LC_MESSAGES+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <locale.h>
-int main() {
+int
+main ()
+{
 return LC_MESSAGES
-; return 0; }
-EOF
-if { (eval echo configure:6965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   am_cv_val_LC_MESSAGES=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  am_cv_val_LC_MESSAGES=no
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+am_cv_val_LC_MESSAGES=no
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-
-echo "$ac_t""$am_cv_val_LC_MESSAGES" 1>&6
+echo "$as_me:$LINENO: result: $am_cv_val_LC_MESSAGES" >&5
+echo "${ECHO_T}$am_cv_val_LC_MESSAGES" >&6
     if test $am_cv_val_LC_MESSAGES = yes; then
-      cat >> confdefs.h <<\EOF
+      cat >>confdefs.h <<\_ACEOF
 #define HAVE_LC_MESSAGES 1
-EOF
+_ACEOF
 
     fi
   fi
-   echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:6986: checking whether NLS is requested" >&5
+   echo "$as_me:$LINENO: checking whether NLS is requested" >&5
+echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6
         # Check whether --enable-nls or --disable-nls was given.
 if test "${enable_nls+set}" = set; then
   enableval="$enable_nls"
   USE_NLS=$enableval
 else
   USE_NLS=yes
-fi
-
-    echo "$ac_t""$USE_NLS" 1>&6
+fi;
+    echo "$as_me:$LINENO: result: $USE_NLS" >&5
+echo "${ECHO_T}$USE_NLS" >&6
     
 
     USE_INCLUDED_LIBINTL=no
 
         if test "$USE_NLS" = "yes"; then
-      cat >> confdefs.h <<\EOF
+      cat >>confdefs.h <<\_ACEOF
 #define ENABLE_NLS 1
-EOF
+_ACEOF
+
+      echo "$as_me:$LINENO: checking whether included gettext is requested" >&5
+echo $ECHO_N "checking whether included gettext is requested... $ECHO_C" >&6
 
-      echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:7006: checking whether included gettext is requested" >&5
-      # Check whether --with-included-gettext or --without-included-gettext was given.
+# Check whether --with-included-gettext or --without-included-gettext was given.
 if test "${with_included_gettext+set}" = set; then
   withval="$with_included_gettext"
   nls_cv_force_use_gnu_gettext=$withval
 else
   nls_cv_force_use_gnu_gettext=no
-fi
-
-      echo "$ac_t""$nls_cv_force_use_gnu_gettext" 1>&6
+fi;
+      echo "$as_me:$LINENO: result: $nls_cv_force_use_gnu_gettext" >&5
+echo "${ECHO_T}$nls_cv_force_use_gnu_gettext" >&6
 
       nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
       if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
@@ -7019,164 +10409,321 @@
 	nls_cv_header_libgt=
 	CATOBJEXT=NONE
 
-	ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:7025: checking for libintl.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 7030 "configure"
-#include "confdefs.h"
+	if test "${ac_cv_header_libintl_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for libintl.h" >&5
+echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6
+if test "${ac_cv_header_libintl_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5
+echo "${ECHO_T}$ac_cv_header_libintl_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking libintl.h usability" >&5
+echo $ECHO_N "checking libintl.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
 #include <libintl.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7035: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
-echo "configure:7052: checking for gettext in libc" >&5
-if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 7057 "configure"
-#include "confdefs.h"
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking libintl.h presence" >&5
+echo $ECHO_N "checking libintl.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <libintl.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+  yes:no )
+    { echo "$as_me:$LINENO: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: libintl.h: proceeding with the preprocessor's result" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+  no:yes )
+    { echo "$as_me:$LINENO: WARNING: libintl.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: libintl.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: libintl.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: libintl.h: check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: libintl.h: proceeding with the preprocessor's result" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for libintl.h" >&5
+echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6
+if test "${ac_cv_header_libintl_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_libintl_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5
+echo "${ECHO_T}$ac_cv_header_libintl_h" >&6
+
+fi
+if test $ac_cv_header_libintl_h = yes; then
+  echo "$as_me:$LINENO: checking for gettext in libc" >&5
+echo $ECHO_N "checking for gettext in libc... $ECHO_C" >&6
+if test "${gt_cv_func_gettext_libc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 #include <libintl.h>
-int main() {
+int
+main ()
+{
 return (int) gettext ("")
-; return 0; }
-EOF
-if { (eval echo configure:7064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   gt_cv_func_gettext_libc=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  gt_cv_func_gettext_libc=no
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+gt_cv_func_gettext_libc=no
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-
-echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6
+echo "$as_me:$LINENO: result: $gt_cv_func_gettext_libc" >&5
+echo "${ECHO_T}$gt_cv_func_gettext_libc" >&6
 
 	   if test "$gt_cv_func_gettext_libc" != "yes"; then
-	     echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
-echo "configure:7080: checking for bindtextdomain in -lintl" >&5
-ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+	     echo "$as_me:$LINENO: checking for bindtextdomain in -lintl" >&5
+echo $ECHO_N "checking for bindtextdomain in -lintl... $ECHO_C" >&6
+if test "${ac_cv_lib_intl_bindtextdomain+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lintl  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 7088 "configure"
-#include "confdefs.h"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char bindtextdomain();
-
-int main() {
-bindtextdomain()
-; return 0; }
-EOF
-if { (eval echo configure:7099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
-echo "configure:7115: checking for gettext in libintl" >&5
-if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6
-echo "configure:7120: checking for gettext in -lintl" >&5
-ac_lib_var=`echo intl'_'gettext | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+char bindtextdomain ();
+int
+main ()
+{
+bindtextdomain ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_intl_bindtextdomain=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_intl_bindtextdomain=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_intl_bindtextdomain" >&5
+echo "${ECHO_T}$ac_cv_lib_intl_bindtextdomain" >&6
+if test $ac_cv_lib_intl_bindtextdomain = yes; then
+  echo "$as_me:$LINENO: checking for gettext in libintl" >&5
+echo $ECHO_N "checking for gettext in libintl... $ECHO_C" >&6
+if test "${gt_cv_func_gettext_libintl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  echo "$as_me:$LINENO: checking for gettext in -lintl" >&5
+echo $ECHO_N "checking for gettext in -lintl... $ECHO_C" >&6
+if test "${ac_cv_lib_intl_gettext+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lintl  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 7128 "configure"
-#include "confdefs.h"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char gettext();
-
-int main() {
-gettext()
-; return 0; }
-EOF
-if { (eval echo configure:7139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+char gettext ();
+int
+main ()
+{
+gettext ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_intl_gettext=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_intl_gettext=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_intl_gettext" >&5
+echo "${ECHO_T}$ac_cv_lib_intl_gettext" >&6
+if test $ac_cv_lib_intl_gettext = yes; then
   gt_cv_func_gettext_libintl=yes
 else
-  echo "$ac_t""no" 1>&6
-gt_cv_func_gettext_libintl=no
+  gt_cv_func_gettext_libintl=no
 fi
 
 fi
-
-echo "$ac_t""$gt_cv_func_gettext_libintl" 1>&6
-else
-  echo "$ac_t""no" 1>&6
+echo "$as_me:$LINENO: result: $gt_cv_func_gettext_libintl" >&5
+echo "${ECHO_T}$gt_cv_func_gettext_libintl" >&6
 fi
 
 	   fi
 
 	   if test "$gt_cv_func_gettext_libc" = "yes" \
 	      || test "$gt_cv_func_gettext_libintl" = "yes"; then
-	      cat >> confdefs.h <<\EOF
+	      cat >>confdefs.h <<\_ACEOF
 #define HAVE_GETTEXT 1
-EOF
+_ACEOF
 
 	      # Extract the first word of "msgfmt", so it can be a program name with args.
 set dummy msgfmt; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7178: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_MSGFMT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   case "$MSGFMT" in
   /*)
@@ -7200,108 +10747,143 @@
 fi
 MSGFMT="$ac_cv_path_MSGFMT"
 if test -n "$MSGFMT"; then
-  echo "$ac_t""$MSGFMT" 1>&6
+  echo "$as_me:$LINENO: result: $MSGFMT" >&5
+echo "${ECHO_T}$MSGFMT" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 	      if test "$MSGFMT" != "no"; then
-		for ac_func in dcgettext
+
+for ac_func in dcgettext
 do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7212: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 7217 "configure"
-#include "confdefs.h"
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
-#include <assert.h>
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
-int main() {
-
+char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
 #endif
 
-; return 0; }
-EOF
-if { (eval echo configure:7240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
  
-else
-  echo "$ac_t""no" 1>&6
 fi
 done
 
 		# Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7267: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_GMSGFMT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case "$GMSGFMT" in
-  /*)
+  case $GMSGFMT in
+  [\\/]* | ?:[\\/]*)
   ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
   ;;
-  ?:/*)			 
-  ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
-  ;;
   *)
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
-      break
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
     fi
-  done
-  IFS="$ac_save_ifs"
+done
+done
+
   test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
   ;;
 esac
 fi
-GMSGFMT="$ac_cv_path_GMSGFMT"
+GMSGFMT=$ac_cv_path_GMSGFMT
+
 if test -n "$GMSGFMT"; then
-  echo "$ac_t""$GMSGFMT" 1>&6
+  echo "$as_me:$LINENO: result: $GMSGFMT" >&5
+echo "${ECHO_T}$GMSGFMT" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
 		# Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7303: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_XGETTEXT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   case "$XGETTEXT" in
   /*)
@@ -7325,38 +10907,56 @@
 fi
 XGETTEXT="$ac_cv_path_XGETTEXT"
 if test -n "$XGETTEXT"; then
-  echo "$ac_t""$XGETTEXT" 1>&6
+  echo "$as_me:$LINENO: result: $XGETTEXT" >&5
+echo "${ECHO_T}$XGETTEXT" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-		cat > conftest.$ac_ext <<EOF
-#line 7335 "configure"
-#include "confdefs.h"
+		cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-int main() {
+int
+main ()
+{
 extern int _nl_msg_cat_cntr;
 			       return _nl_msg_cat_cntr
-; return 0; }
-EOF
-if { (eval echo configure:7343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   CATOBJEXT=.gmo
 		   DATADIRNAME=share
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  CATOBJEXT=.mo
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+CATOBJEXT=.mo
 		   DATADIRNAME=lib
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 		INSTOBJEXT=.mo
 	      fi
 	    fi
 	
-else
-  echo "$ac_t""no" 1>&6
 fi
 
 
@@ -7360,190 +10960,245 @@
 fi
 
 
+
         if test "$CATOBJEXT" = "NONE"; then
-	  echo $ac_n "checking whether catgets can be used""... $ac_c" 1>&6
-echo "configure:7366: checking whether catgets can be used" >&5
-	  # Check whether --with-catgets or --without-catgets was given.
+	  echo "$as_me:$LINENO: checking whether catgets can be used" >&5
+echo $ECHO_N "checking whether catgets can be used... $ECHO_C" >&6
+
+# Check whether --with-catgets or --without-catgets was given.
 if test "${with_catgets+set}" = set; then
   withval="$with_catgets"
   nls_cv_use_catgets=$withval
 else
   nls_cv_use_catgets=no
-fi
-
-	  echo "$ac_t""$nls_cv_use_catgets" 1>&6
+fi;
+	  echo "$as_me:$LINENO: result: $nls_cv_use_catgets" >&5
+echo "${ECHO_T}$nls_cv_use_catgets" >&6
 
 	  if test "$nls_cv_use_catgets" = "yes"; then
-	    	    echo $ac_n "checking for main in -li""... $ac_c" 1>&6
-echo "configure:7379: checking for main in -li" >&5
-ac_lib_var=`echo i'_'main | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+
+echo "$as_me:$LINENO: checking for main in -li" >&5
+echo $ECHO_N "checking for main in -li... $ECHO_C" >&6
+if test "${ac_cv_lib_i_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-li  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 7387 "configure"
-#include "confdefs.h"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-int main() {
-main()
-; return 0; }
-EOF
-if { (eval echo configure:7394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo i | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
+int
+main ()
+{
+main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_i_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_i_main=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_i_main" >&5
+echo "${ECHO_T}$ac_cv_lib_i_main" >&6
+if test $ac_cv_lib_i_main = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBI 1
+_ACEOF
 
   LIBS="-li $LIBS"
 
-else
-  echo "$ac_t""no" 1>&6
 fi
 
-	    echo $ac_n "checking for catgets""... $ac_c" 1>&6
-echo "configure:7422: checking for catgets" >&5
-if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 7427 "configure"
-#include "confdefs.h"
+	    echo "$as_me:$LINENO: checking for catgets" >&5
+echo $ECHO_N "checking for catgets... $ECHO_C" >&6
+if test "${ac_cv_func_catgets+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char catgets(); below.  */
-#include <assert.h>
+    which can conflict with char catgets (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char catgets();
-
-int main() {
-
+char catgets ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_catgets) || defined (__stub___catgets)
 choke me
 #else
-catgets();
+char (*f) () = catgets;
+#endif
+#ifdef __cplusplus
+}
 #endif
 
-; return 0; }
-EOF
-if { (eval echo configure:7450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_catgets=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_catgets=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'catgets`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  cat >> confdefs.h <<\EOF
+int
+main ()
+{
+return f != catgets;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_catgets=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_catgets=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_catgets" >&5
+echo "${ECHO_T}$ac_cv_func_catgets" >&6
+if test $ac_cv_func_catgets = yes; then
+  cat >>confdefs.h <<\_ACEOF
 #define HAVE_CATGETS 1
-EOF
+_ACEOF
 
 	       INTLOBJS="\$(CATOBJS)"
 	       # Extract the first word of "gencat", so it can be a program name with args.
 set dummy gencat; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7472: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_GENCAT'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_GENCAT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case "$GENCAT" in
-  /*)
+  case $GENCAT in
+  [\\/]* | ?:[\\/]*)
   ac_cv_path_GENCAT="$GENCAT" # Let the user override the test with a path.
   ;;
-  ?:/*)			 
-  ac_cv_path_GENCAT="$GENCAT" # Let the user override the test with a dos path.
-  ;;
   *)
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_GENCAT="$ac_dir/$ac_word"
-      break
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_GENCAT="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
     fi
-  done
-  IFS="$ac_save_ifs"
+done
+done
+
   test -z "$ac_cv_path_GENCAT" && ac_cv_path_GENCAT="no"
   ;;
 esac
 fi
-GENCAT="$ac_cv_path_GENCAT"
+GENCAT=$ac_cv_path_GENCAT
+
 if test -n "$GENCAT"; then
-  echo "$ac_t""$GENCAT" 1>&6
+  echo "$as_me:$LINENO: result: $GENCAT" >&5
+echo "${ECHO_T}$GENCAT" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 	       if test "$GENCAT" != "no"; then
 		 # Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7508: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_GMSGFMT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case "$GMSGFMT" in
-  /*)
+  case $GMSGFMT in
+  [\\/]* | ?:[\\/]*)
   ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
   ;;
-  ?:/*)			 
-  ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
-  ;;
   *)
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
-      break
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
     fi
-  done
-  IFS="$ac_save_ifs"
+done
+done
+
   test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="no"
   ;;
 esac
 fi
-GMSGFMT="$ac_cv_path_GMSGFMT"
+GMSGFMT=$ac_cv_path_GMSGFMT
+
 if test -n "$GMSGFMT"; then
-  echo "$ac_t""$GMSGFMT" 1>&6
+  echo "$as_me:$LINENO: result: $GMSGFMT" >&5
+echo "${ECHO_T}$GMSGFMT" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
 		 if test "$GMSGFMT" = "no"; then
 		   # Extract the first word of "msgfmt", so it can be a program name with args.
 set dummy msgfmt; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7545: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_GMSGFMT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   case "$GMSGFMT" in
   /*)
@@ -7567,18 +11222,20 @@
 fi
 GMSGFMT="$ac_cv_path_GMSGFMT"
 if test -n "$GMSGFMT"; then
-  echo "$ac_t""$GMSGFMT" 1>&6
+  echo "$as_me:$LINENO: result: $GMSGFMT" >&5
+echo "${ECHO_T}$GMSGFMT" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
 		 fi
 		 # Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7580: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_XGETTEXT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   case "$XGETTEXT" in
   /*)
@@ -7602,9 +11259,11 @@
 fi
 XGETTEXT="$ac_cv_path_XGETTEXT"
 if test -n "$XGETTEXT"; then
-  echo "$ac_t""$XGETTEXT" 1>&6
+  echo "$as_me:$LINENO: result: $XGETTEXT" >&5
+echo "${ECHO_T}$XGETTEXT" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
 		 USE_INCLUDED_LIBINTL=yes
@@ -7617,8 +11276,6 @@
 		 nls_cv_header_intl=intl/libintl.h
 		 nls_cv_header_libgt=intl/libgettext.h
 	       fi
-else
-  echo "$ac_t""no" 1>&6
 fi
 
 	  fi
@@ -7633,10 +11290,10 @@
                 INTLOBJS="\$(GETTOBJS)"
         # Extract the first word of "msgfmt", so it can be a program name with args.
 set dummy msgfmt; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7638: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_MSGFMT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   case "$MSGFMT" in
   /*)
@@ -7660,53 +11317,59 @@
 fi
 MSGFMT="$ac_cv_path_MSGFMT"
 if test -n "$MSGFMT"; then
-  echo "$ac_t""$MSGFMT" 1>&6
+  echo "$as_me:$LINENO: result: $MSGFMT" >&5
+echo "${ECHO_T}$MSGFMT" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
         # Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7672: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_GMSGFMT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case "$GMSGFMT" in
-  /*)
+  case $GMSGFMT in
+  [\\/]* | ?:[\\/]*)
   ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
   ;;
-  ?:/*)			 
-  ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
-  ;;
   *)
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
-      break
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
     fi
-  done
-  IFS="$ac_save_ifs"
+done
+done
+
   test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
   ;;
 esac
 fi
-GMSGFMT="$ac_cv_path_GMSGFMT"
+GMSGFMT=$ac_cv_path_GMSGFMT
+
 if test -n "$GMSGFMT"; then
-  echo "$ac_t""$GMSGFMT" 1>&6
+  echo "$as_me:$LINENO: result: $GMSGFMT" >&5
+echo "${ECHO_T}$GMSGFMT" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
         # Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7708: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_XGETTEXT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   case "$XGETTEXT" in
   /*)
@@ -7730,9 +11393,11 @@
 fi
 XGETTEXT="$ac_cv_path_XGETTEXT"
 if test -n "$XGETTEXT"; then
-  echo "$ac_t""$XGETTEXT" 1>&6
+  echo "$as_me:$LINENO: result: $XGETTEXT" >&5
+echo "${ECHO_T}$XGETTEXT" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
         
@@ -7751,7 +11416,8 @@
 			if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
 	  : ;
 	else
-	  echo "$ac_t""found xgettext program is not GNU xgettext; ignore it" 1>&6
+	  echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5
+echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6
 	  XGETTEXT=":"
 	fi
       fi
@@ -7763,7 +11429,16 @@
       nls_cv_header_intl=intl/libintl.h
       nls_cv_header_libgt=intl/libgettext.h
     fi
+    ac_sources="$nls_cv_header_libgt"
+ac_dests="$nls_cv_header_intl"
+while test -n "$ac_sources"; do
+  set $ac_dests; ac_dest=$1; shift; ac_dests=$*
+  set $ac_sources; ac_source=$1; shift; ac_sources=$*
+  ac_config_links_1="$ac_config_links_1 $ac_dest:$ac_source"
+done
+          ac_config_links="$ac_config_links $ac_config_links_1"
     
+              ac_config_commands="$ac_config_commands default-1"
     
 
 
@@ -7796,8 +11471,8 @@
      if test "x$ALL_LINGUAS" = "x"; then
        LINGUAS=
      else
-       echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:7801: checking for catalogs to be installed" >&5
+       echo "$as_me:$LINENO: checking for catalogs to be installed" >&5
+echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6
        NEW_LINGUAS=
        for lang in ${LINGUAS=$ALL_LINGUAS}; do
          case "$ALL_LINGUAS" in
@@ -7805,7 +11480,8 @@
          esac
        done
        LINGUAS=$NEW_LINGUAS
-       echo "$ac_t""$LINGUAS" 1>&6
+       echo "$as_me:$LINENO: result: $LINGUAS" >&5
+echo "${ECHO_T}$LINGUAS" >&6
      fi
 
           if test -n "$LINGUAS"; then
@@ -7823,38 +11499,139 @@
 
             test -d intl || mkdir intl
    if test "$CATOBJEXT" = ".cat"; then
-     ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
-echo "configure:7829: checking for linux/version.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 7834 "configure"
-#include "confdefs.h"
+     if test "${ac_cv_header_linux_version_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for linux/version.h" >&5
+echo $ECHO_N "checking for linux/version.h... $ECHO_C" >&6
+if test "${ac_cv_header_linux_version_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_linux_version_h" >&5
+echo "${ECHO_T}$ac_cv_header_linux_version_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking linux/version.h usability" >&5
+echo $ECHO_N "checking linux/version.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
 #include <linux/version.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7839: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking linux/version.h presence" >&5
+echo $ECHO_N "checking linux/version.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <linux/version.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+  yes:no )
+    { echo "$as_me:$LINENO: WARNING: linux/version.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: linux/version.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: linux/version.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: linux/version.h: proceeding with the preprocessor's result" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+  no:yes )
+    { echo "$as_me:$LINENO: WARNING: linux/version.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: linux/version.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: linux/version.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: linux/version.h: check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: linux/version.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: linux/version.h: proceeding with the preprocessor's result" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for linux/version.h" >&5
+echo $ECHO_N "checking for linux/version.h... $ECHO_C" >&6
+if test "${ac_cv_header_linux_version_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_linux_version_h=$ac_header_preproc
 fi
-rm -f conftest*
+echo "$as_me:$LINENO: result: $ac_cv_header_linux_version_h" >&5
+echo "${ECHO_T}$ac_cv_header_linux_version_h" >&6
+
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+if test $ac_cv_header_linux_version_h = yes; then
   msgformat=linux
 else
-  echo "$ac_t""no" 1>&6
-msgformat=xopen
+  msgformat=xopen
 fi
 
 
@@ -8068,8 +11845,8 @@
 fi
 
 # Figure out what assembler alignment features are present.
-echo $ac_n "checking assembler alignment features""... $ac_c" 1>&6
-echo "configure:8073: checking assembler alignment features" >&5
+echo "$as_me:$LINENO: checking assembler alignment features" >&5
+echo $ECHO_N "checking assembler alignment features... $ECHO_C" >&6
 gcc_cv_as=
 gcc_cv_as_alignment_features=
 gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas
@@ -8096,18 +11873,18 @@
 		# bytes to skip when using .p2align.
 		if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 6 -o "$gcc_cv_gas_major_version" -gt 2; then
 			gcc_cv_as_alignment_features=".balign and .p2align"
-			cat >> confdefs.h <<\EOF
+			cat >>confdefs.h <<\_ACEOF
 #define HAVE_GAS_BALIGN_AND_P2ALIGN 1
-EOF
+_ACEOF
 
 		fi
 		# Gas version 2.8 and later support specifying the maximum
 		# bytes to skip when using .p2align.
 		if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 8 -o "$gcc_cv_gas_major_version" -gt 2; then
 			gcc_cv_as_alignment_features=".p2align including maximum skip"
-			cat >> confdefs.h <<\EOF
+			cat >>confdefs.h <<\_ACEOF
 #define HAVE_GAS_MAX_SKIP_P2ALIGN 1
-EOF
+_ACEOF
 
 		fi
 	fi
@@ -8169,9 +11946,9 @@
 	echo ".p2align  2" >> conftest.s
 	if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
 		gcc_cv_as_alignment_features=".balign and .p2align"
-		cat >> confdefs.h <<\EOF
+		cat >>confdefs.h <<\_ACEOF
 #define HAVE_GAS_BALIGN_AND_P2ALIGN 1
-EOF
+_ACEOF
 
 	fi
 	rm -f conftest.s conftest.o
@@ -8180,17 +11957,18 @@
 	echo ".p2align 4,,7" > conftest.s
 	if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
 		gcc_cv_as_alignment_features=".p2align including maximum skip"
-		cat >> confdefs.h <<\EOF
+		cat >>confdefs.h <<\_ACEOF
 #define HAVE_GAS_MAX_SKIP_P2ALIGN 1
-EOF
+_ACEOF
 
 	fi
 	rm -f conftest.s conftest.o
 fi
-echo "$ac_t""$gcc_cv_as_alignment_features" 1>&6
+echo "$as_me:$LINENO: result: $gcc_cv_as_alignment_features" >&5
+echo "${ECHO_T}$gcc_cv_as_alignment_features" >&6
 
-echo $ac_n "checking assembler subsection support""... $ac_c" 1>&6
-echo "configure:8194: checking assembler subsection support" >&5
+echo "$as_me:$LINENO: checking assembler subsection support" >&5
+echo $ECHO_N "checking assembler subsection support... $ECHO_C" >&6
 gcc_cv_as_subsections=
 if test x$gcc_cv_as != x; then
 	# Check if we have .subsection
@@ -8217,9 +11995,9 @@
 					:
 				else
 					gcc_cv_as_subsections="working .subsection -1"
-					cat >> confdefs.h <<\EOF
+					cat >>confdefs.h <<\_ACEOF
 #define HAVE_GAS_SUBSECTION_ORDERING 1
-EOF
+_ACEOF
 
 				fi
 			fi
@@ -8227,10 +12005,11 @@
 	fi
 	rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
 fi
-echo "$ac_t""$gcc_cv_as_subsections" 1>&6
+echo "$as_me:$LINENO: result: $gcc_cv_as_subsections" >&5
+echo "${ECHO_T}$gcc_cv_as_subsections" >&6
 
-echo $ac_n "checking assembler instructions""... $ac_c" 1>&6
-echo "configure:8234: checking assembler instructions" >&5
+echo "$as_me:$LINENO: checking assembler instructions" >&5
+echo $ECHO_N "checking assembler instructions... $ECHO_C" >&6
 gcc_cv_as_instructions=
 if test x$gcc_cv_as != x; then
 	set "filds fists" "filds mem; fists mem"
@@ -8239,16 +12018,17 @@
 		echo "$2" > conftest.s
 		if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
 			gcc_cv_as_instructions=${gcc_cv_as_instructions}$1" "
-			cat >> confdefs.h <<EOF
+			cat >>confdefs.h <<_ACEOF
 #define HAVE_GAS_`echo "$1" | tr 'a-z ' 'A-Z_'` 1
-EOF
+_ACEOF
 
 		fi
 		shift 2
 	done
 	rm -f conftest.s conftest.o
 fi
-echo "$ac_t""$gcc_cv_as_instructions" 1>&6
+echo "$as_me:$LINENO: result: $gcc_cv_as_instructions" >&5
+echo "${ECHO_T}$gcc_cv_as_instructions" >&6
 
 # Figure out what language subdirectories are present.
 # Look if the user specified --enable-languages="..."; if not, use
@@ -8623,519 +12403,533 @@
 
 # Create the Makefile
 # and configure language subdirectories
-trap '' 1 2 15
-cat > confcache <<\EOF
+          ac_config_files="$ac_config_files $all_outputs"
+          ac_config_commands="$ac_config_commands default"
+cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
-# scripts and configure runs.  It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
 #
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already.  You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
 #
-EOF
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
 # The following way of writing the cache mishandles newlines in values,
 # but we know of no workaround that is simple, portable, and efficient.
 # So, don't put newlines in cache variables' values.
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
-(set) 2>&1 |
+{
+  (set) 2>&1 |
   case `(ac_space=' '; set | grep ac_space) 2>&1` in
   *ac_space=\ *)
-    # `set' does not quote correctly, so add quotes (double-quote substitution
-    # turns \\\\ into \\, and sed turns \\ into \).
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
     sed -n \
-      -e "s/'/'\\\\''/g" \
-      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+        "s/'/'\\\\''/g;
+    	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
     ;;
   *)
     # `set' quotes correctly as required by POSIX, so do not add quotes.
-    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+      sed -n \
+        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
     ;;
-  esac >> confcache
-if cmp -s $cache_file confcache; then
-  :
-else
+    esac;
+} |
+  sed '
+     t clear
+     : clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
   if test -w $cache_file; then
-    echo "updating cache $cache_file"
-    cat confcache > $cache_file
+    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+    cat confcache >$cache_file
   else
     echo "not updating unwritable cache $cache_file"
   fi
 fi
 rm -f confcache
 
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
 test "x$prefix" = xNONE && prefix=$ac_default_prefix
 # Let make expand exec_prefix.
 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
 
-# Any assignment to VPATH causes Sun make to only execute
-# the first set of double-colon rules, so remove it if not needed.
-# If there is a colon in the path, we need to keep it.
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
 if test "x$srcdir" = x.; then
-  ac_vpsub='/^[ 	]*VPATH[ 	]*=[^:]*$/d'
+  ac_vpsub='/^[ 	]*VPATH[ 	]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[ 	]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ 	]*$//;
+}'
 fi
 
-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-
 DEFS=-DHAVE_CONFIG_H
 
-# Without the "./", some shells look in PATH for config.status.
-: ${CONFIG_STATUS=./config.status}
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_i=`echo "$ac_i" |
+         sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+  # 2. Add them.
+  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
 
-echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
-cat > $CONFIG_STATUS <<EOF
-#! /bin/sh
-# Generated automatically by configure.
-# Run this file to recreate the current configuration.
-# This directory was configured as follows,
-# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-#
-# $0 $ac_configure_args
-#
-# Compiler output produced by configure, useful for debugging
-# configure, is in ./config.log if it exists.
+LTLIBOBJS=$ac_ltlibobjs
 
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-for ac_option
-do
-  case "\$ac_option" in
-  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
-    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
-    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
-    echo "$CONFIG_STATUS generated by autoconf version 2.13"
-    exit 0 ;;
-  -help | --help | --hel | --he | --h)
-    echo "\$ac_cs_usage"; exit 0 ;;
-  *) echo "\$ac_cs_usage"; exit 1 ;;
-  esac
-done
 
-ac_given_srcdir=$srcdir
 
-trap 'rm -fr `echo "$all_outputs auto-host.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-EOF
-cat >> $CONFIG_STATUS <<EOF
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
 
-# Protect against being on the right side of a sed subst in config.status.
-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
-$ac_vpsub
-$extrasub
-s%@SHELL@%$SHELL%g
-s%@CFLAGS@%$CFLAGS%g
-s%@CPPFLAGS@%$CPPFLAGS%g
-s%@CXXFLAGS@%$CXXFLAGS%g
-s%@FFLAGS@%$FFLAGS%g
-s%@DEFS@%$DEFS%g
-s%@LDFLAGS@%$LDFLAGS%g
-s%@LIBS@%$LIBS%g
-s%@exec_prefix@%$exec_prefix%g
-s%@prefix@%$prefix%g
-s%@program_transform_name@%$program_transform_name%g
-s%@bindir@%$bindir%g
-s%@sbindir@%$sbindir%g
-s%@libexecdir@%$libexecdir%g
-s%@datadir@%$datadir%g
-s%@sysconfdir@%$sysconfdir%g
-s%@sharedstatedir@%$sharedstatedir%g
-s%@localstatedir@%$localstatedir%g
-s%@libdir@%$libdir%g
-s%@includedir@%$includedir%g
-s%@oldincludedir@%$oldincludedir%g
-s%@infodir@%$infodir%g
-s%@mandir@%$mandir%g
-s%@host@%$host%g
-s%@host_alias@%$host_alias%g
-s%@host_cpu@%$host_cpu%g
-s%@host_vendor@%$host_vendor%g
-s%@host_os@%$host_os%g
-s%@target@%$target%g
-s%@target_alias@%$target_alias%g
-s%@target_cpu@%$target_cpu%g
-s%@target_vendor@%$target_vendor%g
-s%@target_os@%$target_os%g
-s%@build@%$build%g
-s%@build_alias@%$build_alias%g
-s%@build_cpu@%$build_cpu%g
-s%@build_vendor@%$build_vendor%g
-s%@build_os@%$build_os%g
-s%@CC@%$CC%g
-s%@stage1_warn_cflags@%$stage1_warn_cflags%g
-s%@SET_MAKE@%$SET_MAKE%g
-s%@AWK@%$AWK%g
-s%@LEX@%$LEX%g
-s%@LEXLIB@%$LEXLIB%g
-s%@LN@%$LN%g
-s%@LN_S@%$LN_S%g
-s%@RANLIB@%$RANLIB%g
-s%@YACC@%$YACC%g
-s%@INSTALL@%$INSTALL%g
-s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
-s%@CPP@%$CPP%g
-s%@gnat@%$gnat%g
-s%@vfprintf@%$vfprintf%g
-s%@doprint@%$doprint%g
-s%@manext@%$manext%g
-s%@objext@%$objext%g
-s%@PACKAGE@%$PACKAGE%g
-s%@VERSION@%$VERSION%g
-s%@ALLOCA@%$ALLOCA%g
-s%@USE_NLS@%$USE_NLS%g
-s%@MSGFMT@%$MSGFMT%g
-s%@GMSGFMT@%$GMSGFMT%g
-s%@XGETTEXT@%$XGETTEXT%g
-s%@GENCAT@%$GENCAT%g
-s%@USE_INCLUDED_LIBINTL@%$USE_INCLUDED_LIBINTL%g
-s%@CATALOGS@%$CATALOGS%g
-s%@CATOBJEXT@%$CATOBJEXT%g
-s%@DATADIRNAME@%$DATADIRNAME%g
-s%@GMOFILES@%$GMOFILES%g
-s%@INSTOBJEXT@%$INSTOBJEXT%g
-s%@INTLDEPS@%$INTLDEPS%g
-s%@INTLLIBS@%$INTLLIBS%g
-s%@INTLOBJS@%$INTLOBJS%g
-s%@POFILES@%$POFILES%g
-s%@POSUB@%$POSUB%g
-s%@INCLUDE_LOCALE_H@%$INCLUDE_LOCALE_H%g
-s%@GT_NO@%$GT_NO%g
-s%@GT_YES@%$GT_YES%g
-s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g
-s%@l@%$l%g
-s%@gthread_flags@%$gthread_flags%g
-s%@build_canonical@%$build_canonical%g
-s%@host_canonical@%$host_canonical%g
-s%@target_subdir@%$target_subdir%g
-s%@inhibit_libc@%$inhibit_libc%g
-s%@sched_prefix@%$sched_prefix%g
-s%@sched_cflags@%$sched_cflags%g
-s%@gcc_tooldir@%$gcc_tooldir%g
-s%@dollar@%$dollar%g
-s%@objdir@%$objdir%g
-s%@subdirs@%$subdirs%g
-s%@all_boot_languages@%$all_boot_languages%g
-s%@all_compilers@%$all_compilers%g
-s%@all_diff_excludes@%$all_diff_excludes%g
-s%@all_headers@%$all_headers%g
-s%@all_lang_makefiles@%$all_lang_makefiles%g
-s%@all_languages@%$all_languages%g
-s%@all_lib2funcs@%$all_lib2funcs%g
-s%@all_stagestuff@%$all_stagestuff%g
-s%@build_exeext@%$build_exeext%g
-s%@build_install_headers_dir@%$build_install_headers_dir%g
-s%@build_xm_file_list@%$build_xm_file_list%g
-s%@cc_set_by_configure@%$cc_set_by_configure%g
-s%@quoted_cc_set_by_configure@%$quoted_cc_set_by_configure%g
-s%@cpp_install_dir@%$cpp_install_dir%g
-s%@cpp_main@%$cpp_main%g
-s%@dep_host_xmake_file@%$dep_host_xmake_file%g
-s%@dep_tmake_file@%$dep_tmake_file%g
-s%@extra_c_flags@%$extra_c_flags%g
-s%@extra_c_objs@%$extra_c_objs%g
-s%@extra_cpp_objs@%$extra_cpp_objs%g
-s%@extra_cxx_objs@%$extra_cxx_objs%g
-s%@extra_headers_list@%$extra_headers_list%g
-s%@extra_objs@%$extra_objs%g
-s%@extra_parts@%$extra_parts%g
-s%@extra_passes@%$extra_passes%g
-s%@extra_programs@%$extra_programs%g
-s%@fixinc_defs@%$fixinc_defs%g
-s%@float_h_file@%$float_h_file%g
-s%@gcc_gxx_include_dir@%$gcc_gxx_include_dir%g
-s%@gcc_version@%$gcc_version%g
-s%@gcc_version_trigger@%$gcc_version_trigger%g
-s%@host_exeext@%$host_exeext%g
-s%@host_extra_gcc_objs@%$host_extra_gcc_objs%g
-s%@host_xm_file_list@%$host_xm_file_list%g
-s%@install@%$install%g
-s%@JAVAGC@%$JAVAGC%g
-s%@lang_options_files@%$lang_options_files%g
-s%@lang_specs_files@%$lang_specs_files%g
-s%@lang_tree_files@%$lang_tree_files%g
-s%@local_prefix@%$local_prefix%g
-s%@maybe_use_collect2@%$maybe_use_collect2%g
-s%@md_file@%$md_file%g
-s%@objc_boehm_gc@%$objc_boehm_gc%g
-s%@out_file@%$out_file%g
-s%@out_object_file@%$out_object_file%g
-s%@stage_prefix_set_by_configure@%$stage_prefix_set_by_configure%g
-s%@symbolic_link@%$symbolic_link%g
-s%@thread_file@%$thread_file%g
-s%@tm_file_list@%$tm_file_list%g
-s%@will_use_collect2@%$will_use_collect2%g
-/@target_overrides@/r $target_overrides
-s%@target_overrides@%%g
-/@host_overrides@/r $host_overrides
-s%@host_overrides@%%g
-s%@cross_defines@%$cross_defines%g
-/@cross_overrides@/r $cross_overrides
-s%@cross_overrides@%%g
-/@build_overrides@/r $build_overrides
-s%@build_overrides@%%g
-/@language_fragments@/r $language_fragments
-s%@language_fragments@%%g
-/@language_hooks@/r $language_hooks
-s%@language_hooks@%%g
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
 
-CEOF
-EOF
 
-cat >> $CONFIG_STATUS <<\EOF
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
 
-# Split the substitutions into bite-sized pieces for seds with
-# small command number limits, like on Digital OSF/1 and HP-UX.
-ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
-ac_file=1 # Number of current file.
-ac_beg=1 # First line for current file.
-ac_end=$ac_max_sed_cmds # Line after last line for current file.
-ac_more_lines=:
-ac_sed_cmds=""
-while $ac_more_lines; do
-  if test $ac_beg -gt 1; then
-    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
-  else
-    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
-  fi
-  if test ! -s conftest.s$ac_file; then
-    ac_more_lines=false
-    rm -f conftest.s$ac_file
-  else
-    if test -z "$ac_sed_cmds"; then
-      ac_sed_cmds="sed -f conftest.s$ac_file"
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
     else
-      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
-    fi
-    ac_file=`expr $ac_file + 1`
-    ac_beg=$ac_end
-    ac_end=`expr $ac_end + $ac_max_sed_cmds`
+    $as_unset $as_var
   fi
 done
-if test -z "$ac_sed_cmds"; then
-  ac_sed_cmds=cat
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
 fi
-EOF
 
-cat >> $CONFIG_STATUS <<EOF
 
-CONFIG_FILES=\${CONFIG_FILES-"$all_outputs"}
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-  case "$ac_file" in
-  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
-       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
-  *) ac_file_in="${ac_file}.in" ;;
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)$' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+	 case $as_dir in
+	 /*)
+	   if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+	     CONFIG_SHELL=$as_dir/$as_base
+	     export CONFIG_SHELL
+	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+	   fi;;
+	 esac
+       done
+done
+;;
   esac
 
-  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
-
-  # Remove last slash and all that follows it.  Not all systems have dirname.
-  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
-  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
-    # The file is in a subdirectory.
-    test ! -d "$ac_dir" && mkdir "$ac_dir"
-    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
-    # A "../" for each directory in $ac_dir_suffix.
-    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
   else
-    ac_dir_suffix= ac_dots=
+    as_ln_s='ln -s'
   fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
 
-  case "$ac_given_srcdir" in
-  .)  srcdir=.
-      if test -z "$ac_dots"; then top_srcdir=.
-      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
-  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
-  *) # Relative path.
-    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
-    top_srcdir="$ac_dots$ac_given_srcdir" ;;
-  esac
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  as_mkdir_p=false
+fi
 
+as_executable_p="test -f"
 
-  echo creating "$ac_file"
-  rm -f "$ac_file"
-  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
-  case "$ac_file" in
-  *Makefile*) ac_comsub="1i\\
-# $configure_input" ;;
-  *) ac_comsub= ;;
-  esac
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
 
-  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
-  sed -e "$ac_comsub
-s%@configure_input@%$configure_input%g
-s%@srcdir@%$srcdir%g
-s%@top_srcdir@%$top_srcdir%g
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
-fi; done
-rm -f conftest.s*
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
 
-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
-# NAME is the cpp macro being defined and VALUE is the value it is being given.
-#
-# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s%^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
-ac_dB='\([ 	][ 	]*\)[^ 	]*%\1#\2'
-ac_dC='\3'
-ac_dD='%g'
-# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
-ac_uA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
-ac_uB='\([ 	]\)%\1#\2define\3'
-ac_uC=' '
-ac_uD='\4%g'
-# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_eA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
-ac_eB='$%\1#\2define\3'
-ac_eC=' '
-ac_eD='%g'
 
-if test "${CONFIG_HEADERS+set}" != set; then
-EOF
-cat >> $CONFIG_STATUS <<EOF
-  CONFIG_HEADERS="auto-host.h:config.in"
-EOF
-cat >> $CONFIG_STATUS <<\EOF
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.  Logging --version etc. is OK.
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by $as_me, which was
+generated by GNU Autoconf 2.57.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
 fi
-for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-  case "$ac_file" in
-  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
-       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
-  *) ac_file_in="${ac_file}.in" ;;
-  esac
 
-  echo creating $ac_file
+if test -n "$ac_config_headers"; then
+  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
 
-  rm -f conftest.frag conftest.in conftest.out
-  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
-  cat $ac_file_inputs > conftest.in
+if test -n "$ac_config_links"; then
+  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
 
-EOF
+if test -n "$ac_config_commands"; then
+  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
 
-# Transform confdefs.h into a sed script conftest.vals that substitutes
-# the proper values into config.h.in to produce config.h.  And first:
-# Protect against being on the right side of a sed subst in config.status.
-# Protect against being in an unquoted here document in config.status.
-rm -f conftest.vals
-cat > conftest.hdr <<\EOF
-s/[\\&%]/\\&/g
-s%[\\$`]%\\&%g
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
-s%ac_d%ac_u%gp
-s%ac_u%ac_e%gp
-EOF
-sed -n -f conftest.hdr confdefs.h > conftest.vals
-rm -f conftest.hdr
+cat >>$CONFIG_STATUS <<\_ACEOF
 
-# This sed command replaces #undef with comments.  This is necessary, for
-# example, in the case of _POSIX_SOURCE, which is predefined and required
-# on some systems where configure will not decide to define it.
-cat >> conftest.vals <<\EOF
-s%^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
-EOF
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
 
-# Break up conftest.vals because some shells have a limit on
-# the size of here documents, and old seds have small limits too.
+Usage: $0 [OPTIONS] [FILE]...
 
-rm -f conftest.tail
-while :
-do
-  ac_lines=`grep -c . conftest.vals`
-  # grep -c gives empty output for an empty file on some AIX systems.
-  if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
-  # Write a limited-size here document to conftest.frag.
-  echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
-  sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
-  echo 'CEOF
-  sed -f conftest.frag conftest.in > conftest.out
-  rm -f conftest.in
-  mv conftest.out conftest.in
-' >> $CONFIG_STATUS
-  sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
-  rm -f conftest.vals
-  mv conftest.tail conftest.vals
-done
-rm -f conftest.vals
-
-cat >> $CONFIG_STATUS <<\EOF
-  rm -f conftest.frag conftest.h
-  echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
-  cat conftest.in >> conftest.h
-  rm -f conftest.in
-  if cmp -s $ac_file conftest.h 2>/dev/null; then
-    echo "$ac_file is unchanged"
-    rm -f conftest.h
-  else
-    # Remove last slash and all that follows it.  Not all systems have dirname.
-      ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
-      if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
-      # The file is in a subdirectory.
-      test ! -d "$ac_dir" && mkdir "$ac_dir"
-    fi
-    rm -f $ac_file
-    mv conftest.h $ac_file
-  fi
-fi; done
+  -h, --help       print this help, then exit
+  -V, --version    print version number, then exit
+  -q, --quiet      do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+  --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+  --header=FILE[:TEMPLATE]
+                   instantiate the configuration header FILE
 
-EOF
+Configuration files:
+$config_files
 
-cat >> $CONFIG_STATUS <<EOF
-ac_sources="$nls_cv_header_libgt"
-ac_dests="$nls_cv_header_intl"
-EOF
+Configuration headers:
+$config_headers
 
-cat >> $CONFIG_STATUS <<\EOF
-srcdir=$ac_given_srcdir
-while test -n "$ac_sources"; do
-  set $ac_dests; ac_dest=$1; shift; ac_dests=$*
-  set $ac_sources; ac_source=$1; shift; ac_sources=$*
+Configuration links:
+$config_links
 
-  echo "linking $srcdir/$ac_source to $ac_dest"
+Configuration commands:
+$config_commands
 
-  if test ! -r $srcdir/$ac_source; then
-    { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; }
-  fi
-  rm -f $ac_dest
+Report bugs to <bug-autoconf@gnu.org>."
+_ACEOF
 
-  # Make relative symlinks.
-  # Remove last slash and all that follows it.  Not all systems have dirname.
-  ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'`
-  if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
-    # The dest file is in a subdirectory.
-    test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
-    ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
-    # A "../" for each directory in $ac_dest_dir_suffix.
-    ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
-  else
-    ac_dest_dir_suffix= ac_dots=
-  fi
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+config.status
+configured by $0, generated by GNU Autoconf 2.57,
+  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
 
-  case "$srcdir" in
-  [/$]*) ac_rel_source="$srcdir/$ac_source" ;;
-  *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
-  esac
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+_ACEOF
 
-  # Make a symlink if possible; otherwise try a hard link.
-  if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
-    ln $srcdir/$ac_source $ac_dest; then :
-  else
-    { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; }
-  fi
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value.  By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "x$1" : 'x\([^=]*\)='`
+    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  -*)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  *) # This is not an option, so the user has probably given explicit
+     # arguments.
+     ac_option=$1
+     ac_need_defaults=false;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --vers* | -V )
+    echo "$ac_cs_version"; exit 0 ;;
+  --he | --h)
+    # Conflict between --help and --header
+    { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    echo "$ac_cs_usage"; exit 0 ;;
+  --debug | --d* | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+    ac_need_defaults=false;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1" ;;
+
+  esac
+  shift
 done
-EOF
-cat >> $CONFIG_STATUS <<EOF
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS section.
+#
+
 
 
 host='${host}'
@@ -9170,12 +12964,834 @@
 build_overrides='${build_overrides}'
 cpp_install_dir='${cpp_install_dir}'
 
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-case "$CONFIG_FILES" in *po/Makefile.in*)
-        sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
+
+_ACEOF
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+  case "$ac_config_target" in
+  # Handling of arguments.
+  "$all_outputs" ) CONFIG_FILES="$CONFIG_FILES $all_outputs" ;;
+  "$ac_config_links_1" ) CONFIG_LINKS="$CONFIG_LINKS $ac_config_links_1" ;;
+  "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
+  "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
+  "auto-host.h" ) CONFIG_HEADERS="$CONFIG_HEADERS auto-host.h:config.in" ;;
+  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
       esac
+done
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./confstat$$-$RANDOM
+  (umask 077 && mkdir $tmp)
+} ||
+{
+   echo "$me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+  # Protect against being on the right side of a sed subst in config.status.
+  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@LIBS@,$LIBS,;t t
+s,@build@,$build,;t t
+s,@build_cpu@,$build_cpu,;t t
+s,@build_vendor@,$build_vendor,;t t
+s,@build_os@,$build_os,;t t
+s,@host@,$host,;t t
+s,@host_cpu@,$host_cpu,;t t
+s,@host_vendor@,$host_vendor,;t t
+s,@host_os@,$host_os,;t t
+s,@target@,$target,;t t
+s,@target_cpu@,$target_cpu,;t t
+s,@target_vendor@,$target_vendor,;t t
+s,@target_os@,$target_os,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@stage1_warn_cflags@,$stage1_warn_cflags,;t t
+s,@SET_MAKE@,$SET_MAKE,;t t
+s,@AWK@,$AWK,;t t
+s,@LEX@,$LEX,;t t
+s,@LEXLIB@,$LEXLIB,;t t
+s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t
+s,@LN@,$LN,;t t
+s,@LN_S@,$LN_S,;t t
+s,@RANLIB@,$RANLIB,;t t
+s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s,@YACC@,$YACC,;t t
+s,@INSTALL@,$INSTALL,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@CPP@,$CPP,;t t
+s,@EGREP@,$EGREP,;t t
+s,@gnat@,$gnat,;t t
+s,@vfprintf@,$vfprintf,;t t
+s,@doprint@,$doprint,;t t
+s,@manext@,$manext,;t t
+s,@objext@,$objext,;t t
+s,@PACKAGE@,$PACKAGE,;t t
+s,@VERSION@,$VERSION,;t t
+s,@ALLOCA@,$ALLOCA,;t t
+s,@USE_NLS@,$USE_NLS,;t t
+s,@MSGFMT@,$MSGFMT,;t t
+s,@GMSGFMT@,$GMSGFMT,;t t
+s,@XGETTEXT@,$XGETTEXT,;t t
+s,@GENCAT@,$GENCAT,;t t
+s,@USE_INCLUDED_LIBINTL@,$USE_INCLUDED_LIBINTL,;t t
+s,@CATALOGS@,$CATALOGS,;t t
+s,@CATOBJEXT@,$CATOBJEXT,;t t
+s,@DATADIRNAME@,$DATADIRNAME,;t t
+s,@GMOFILES@,$GMOFILES,;t t
+s,@INSTOBJEXT@,$INSTOBJEXT,;t t
+s,@INTLDEPS@,$INTLDEPS,;t t
+s,@INTLLIBS@,$INTLLIBS,;t t
+s,@INTLOBJS@,$INTLOBJS,;t t
+s,@POFILES@,$POFILES,;t t
+s,@POSUB@,$POSUB,;t t
+s,@INCLUDE_LOCALE_H@,$INCLUDE_LOCALE_H,;t t
+s,@GT_NO@,$GT_NO,;t t
+s,@GT_YES@,$GT_YES,;t t
+s,@MKINSTALLDIRS@,$MKINSTALLDIRS,;t t
+s,@l@,$l,;t t
+s,@gthread_flags@,$gthread_flags,;t t
+s,@build_canonical@,$build_canonical,;t t
+s,@host_canonical@,$host_canonical,;t t
+s,@target_subdir@,$target_subdir,;t t
+s,@inhibit_libc@,$inhibit_libc,;t t
+s,@sched_prefix@,$sched_prefix,;t t
+s,@sched_cflags@,$sched_cflags,;t t
+s,@gcc_tooldir@,$gcc_tooldir,;t t
+s,@dollar@,$dollar,;t t
+s,@objdir@,$objdir,;t t
+s,@subdirs@,$subdirs,;t t
+s,@all_boot_languages@,$all_boot_languages,;t t
+s,@all_compilers@,$all_compilers,;t t
+s,@all_diff_excludes@,$all_diff_excludes,;t t
+s,@all_headers@,$all_headers,;t t
+s,@all_lang_makefiles@,$all_lang_makefiles,;t t
+s,@all_languages@,$all_languages,;t t
+s,@all_lib2funcs@,$all_lib2funcs,;t t
+s,@all_stagestuff@,$all_stagestuff,;t t
+s,@build_exeext@,$build_exeext,;t t
+s,@build_install_headers_dir@,$build_install_headers_dir,;t t
+s,@build_xm_file_list@,$build_xm_file_list,;t t
+s,@cc_set_by_configure@,$cc_set_by_configure,;t t
+s,@quoted_cc_set_by_configure@,$quoted_cc_set_by_configure,;t t
+s,@cpp_install_dir@,$cpp_install_dir,;t t
+s,@cpp_main@,$cpp_main,;t t
+s,@dep_host_xmake_file@,$dep_host_xmake_file,;t t
+s,@dep_tmake_file@,$dep_tmake_file,;t t
+s,@extra_c_flags@,$extra_c_flags,;t t
+s,@extra_c_objs@,$extra_c_objs,;t t
+s,@extra_cpp_objs@,$extra_cpp_objs,;t t
+s,@extra_cxx_objs@,$extra_cxx_objs,;t t
+s,@extra_headers_list@,$extra_headers_list,;t t
+s,@extra_objs@,$extra_objs,;t t
+s,@extra_parts@,$extra_parts,;t t
+s,@extra_passes@,$extra_passes,;t t
+s,@extra_programs@,$extra_programs,;t t
+s,@fixinc_defs@,$fixinc_defs,;t t
+s,@float_h_file@,$float_h_file,;t t
+s,@gcc_gxx_include_dir@,$gcc_gxx_include_dir,;t t
+s,@gcc_version@,$gcc_version,;t t
+s,@gcc_version_trigger@,$gcc_version_trigger,;t t
+s,@host_exeext@,$host_exeext,;t t
+s,@host_extra_gcc_objs@,$host_extra_gcc_objs,;t t
+s,@host_xm_file_list@,$host_xm_file_list,;t t
+s,@install@,$install,;t t
+s,@JAVAGC@,$JAVAGC,;t t
+s,@lang_options_files@,$lang_options_files,;t t
+s,@lang_specs_files@,$lang_specs_files,;t t
+s,@lang_tree_files@,$lang_tree_files,;t t
+s,@local_prefix@,$local_prefix,;t t
+s,@maybe_use_collect2@,$maybe_use_collect2,;t t
+s,@md_file@,$md_file,;t t
+s,@objc_boehm_gc@,$objc_boehm_gc,;t t
+s,@out_file@,$out_file,;t t
+s,@out_object_file@,$out_object_file,;t t
+s,@stage_prefix_set_by_configure@,$stage_prefix_set_by_configure,;t t
+s,@symbolic_link@,$symbolic_link,;t t
+s,@thread_file@,$thread_file,;t t
+s,@tm_file_list@,$tm_file_list,;t t
+s,@will_use_collect2@,$will_use_collect2,;t t
+s,@cross_defines@,$cross_defines,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@LTLIBOBJS@,$LTLIBOBJS,;t t
+/@target_overrides@/r $target_overrides
+s,@target_overrides@,,;t t
+/@host_overrides@/r $host_overrides
+s,@host_overrides@,,;t t
+/@cross_overrides@/r $cross_overrides
+s,@cross_overrides@,,;t t
+/@build_overrides@/r $build_overrides
+s,@build_overrides@,,;t t
+/@language_fragments@/r $language_fragments
+s,@language_fragments@,,;t t
+/@language_hooks@/r $language_hooks
+s,@language_hooks@,,;t t
+CEOF
+
+_ACEOF
+
+  cat >>$CONFIG_STATUS <<\_ACEOF
+  # Split the substitutions into bite-sized pieces for seds with
+  # small command number limits, like on Digital OSF/1 and HP-UX.
+  ac_max_sed_lines=48
+  ac_sed_frag=1 # Number of current file.
+  ac_beg=1 # First line for current file.
+  ac_end=$ac_max_sed_lines # Line after last line for current file.
+  ac_more_lines=:
+  ac_sed_cmds=
+  while $ac_more_lines; do
+    if test $ac_beg -gt 1; then
+      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    else
+      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    fi
+    if test ! -s $tmp/subs.frag; then
+      ac_more_lines=false
+    else
+      # The purpose of the label and of the branching condition is to
+      # speed up the sed processing (if there are no `@' at all, there
+      # is no need to browse any of the substitutions).
+      # These are the two extra sed commands mentioned above.
+      (echo ':t
+  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+      if test -z "$ac_sed_cmds"; then
+  	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+      else
+  	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+      fi
+      ac_sed_frag=`expr $ac_sed_frag + 1`
+      ac_beg=$ac_end
+      ac_end=`expr $ac_end + $ac_max_sed_lines`
+    fi
+  done
+  if test -z "$ac_sed_cmds"; then
+    ac_sed_cmds=cat
+  fi
+fi # test -n "$CONFIG_FILES"
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+        cat >$tmp/stdin
+        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
+  esac
+
+  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+         X"$ac_file" : 'X\(//\)[^/]' \| \
+         X"$ac_file" : 'X\(//\)$' \| \
+         X"$ac_file" : 'X\(/\)' \| \
+         .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+         X"$as_dir" : 'X\(//\)[^/]' \| \
+         X"$as_dir" : 'X\(//\)$' \| \
+         X"$as_dir" : 'X\(/\)' \| \
+         .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+  ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
 
+
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated by config.status.  */
+  if test x"$ac_file" = x-; then
+    configure_input=
+  else
+    configure_input="$ac_file.  "
+  fi
+  configure_input=$configure_input"Generated from `echo $ac_file_in |
+                                     sed 's,.*/,,'` by configure."
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+         # Absolute (can't be DOS-style, as IFS=:)
+         test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+         echo $f;;
+      *) # Relative
+         if test -f "$f"; then
+           # Build tree
+           echo $f
+         elif test -f "$srcdir/$f"; then
+           # Source tree
+           echo $srcdir/$f
+         else
+           # /dev/null tree
+           { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+         fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+  rm -f $tmp/stdin
+  if test x"$ac_file" != x-; then
+    mv $tmp/out $ac_file
+  else
+    cat $tmp/out
+    rm -f $tmp/out
+  fi
+
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_HEADER section.
+#
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s,^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
+ac_dB='[ 	].*$,\1#\2'
+ac_dC=' '
+ac_dD=',;t'
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_uA='s,^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
+ac_uB='$,\1#\2define\3'
+ac_uC=' '
+ac_uD=',;t'
+
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+        cat >$tmp/stdin
+        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
+  esac
+
+  test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+         # Absolute (can't be DOS-style, as IFS=:)
+         test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+         echo $f;;
+      *) # Relative
+         if test -f "$f"; then
+           # Build tree
+           echo $f
+         elif test -f "$srcdir/$f"; then
+           # Source tree
+           echo $srcdir/$f
+         else
+           # /dev/null tree
+           { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+         fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+  # Remove the trailing spaces.
+  sed 's/[ 	]*$//' $ac_file_inputs >$tmp/in
+
+_ACEOF
+
+# Transform confdefs.h into two sed scripts, `conftest.defines' and
+# `conftest.undefs', that substitutes the proper values into
+# config.h.in to produce config.h.  The first handles `#define'
+# templates, and the second `#undef' templates.
+# And first: Protect against being on the right side of a sed subst in
+# config.status.  Protect against being in an unquoted here document
+# in config.status.
+rm -f conftest.defines conftest.undefs
+# Using a here document instead of a string reduces the quoting nightmare.
+# Putting comments in sed scripts is not portable.
+#
+# `end' is used to avoid that the second main sed command (meant for
+# 0-ary CPP macros) applies to n-ary macro definitions.
+# See the Autoconf documentation for `clear'.
+cat >confdef2sed.sed <<\_ACEOF
+s/[\\&,]/\\&/g
+s,[\\$`],\\&,g
+t clear
+: clear
+s,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	(][^ 	(]*\)\(([^)]*)\)[ 	]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+t end
+s,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	][^ 	]*\)[ 	]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+: end
+_ACEOF
+# If some macros were called several times there might be several times
+# the same #defines, which is useless.  Nevertheless, we may not want to
+# sort them, since we want the *last* AC-DEFINE to be honored.
+uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
+sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
+rm -f confdef2sed.sed
+
+# This sed command replaces #undef with comments.  This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >>conftest.undefs <<\_ACEOF
+s,^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+_ACEOF
+
+# Break up conftest.defines because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+echo '  if grep "^[ 	]*#[ 	]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+echo '  :' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.defines >/dev/null
+do
+  # Write a limited-size here document to $tmp/defines.sed.
+  echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+  # Speed up: don't consider the non `#define' lines.
+  echo '/^[ 	]*#[ 	]*define/!b' >>$CONFIG_STATUS
+  # Work around the forget-to-reset-the-flag bug.
+  echo 't clr' >>$CONFIG_STATUS
+  echo ': clr' >>$CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+  echo 'CEOF
+  sed -f $tmp/defines.sed $tmp/in >$tmp/out
+  rm -f $tmp/in
+  mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+  rm -f conftest.defines
+  mv conftest.tail conftest.defines
+done
+rm -f conftest.defines
+echo '  fi # grep' >>$CONFIG_STATUS
+echo >>$CONFIG_STATUS
+
+# Break up conftest.undefs because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.undefs >/dev/null
+do
+  # Write a limited-size here document to $tmp/undefs.sed.
+  echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+  # Speed up: don't consider the non `#undef'
+  echo '/^[ 	]*#[ 	]*undef/!b' >>$CONFIG_STATUS
+  # Work around the forget-to-reset-the-flag bug.
+  echo 't clr' >>$CONFIG_STATUS
+  echo ': clr' >>$CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
+  echo 'CEOF
+  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+  rm -f $tmp/in
+  mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
+  rm -f conftest.undefs
+  mv conftest.tail conftest.undefs
+done
+rm -f conftest.undefs
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated by config.status.  */
+  if test x"$ac_file" = x-; then
+    echo "/* Generated by configure.  */" >$tmp/config.h
+  else
+    echo "/* $ac_file.  Generated by configure.  */" >$tmp/config.h
+  fi
+  cat $tmp/in >>$tmp/config.h
+  rm -f $tmp/in
+  if test x"$ac_file" != x-; then
+    if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+         X"$ac_file" : 'X\(//\)[^/]' \| \
+         X"$ac_file" : 'X\(//\)$' \| \
+         X"$ac_file" : 'X\(/\)' \| \
+         .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+      { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+         X"$as_dir" : 'X\(//\)[^/]' \| \
+         X"$as_dir" : 'X\(//\)$' \| \
+         X"$as_dir" : 'X\(/\)' \| \
+         .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+      rm -f $ac_file
+      mv $tmp/config.h $ac_file
+    fi
+  else
+    cat $tmp/config.h
+    rm -f $tmp/config.h
+  fi
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_LINKS section.
+#
+
+for ac_file in : $CONFIG_LINKS; do test "x$ac_file" = x: && continue
+  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+
+  { echo "$as_me:$LINENO: linking $srcdir/$ac_source to $ac_dest" >&5
+echo "$as_me: linking $srcdir/$ac_source to $ac_dest" >&6;}
+
+  if test ! -r $srcdir/$ac_source; then
+    { { echo "$as_me:$LINENO: error: $srcdir/$ac_source: file not found" >&5
+echo "$as_me: error: $srcdir/$ac_source: file not found" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+  rm -f $ac_dest
+
+  # Make relative symlinks.
+  ac_dest_dir=`(dirname "$ac_dest") 2>/dev/null ||
+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+         X"$ac_dest" : 'X\(//\)[^/]' \| \
+         X"$ac_dest" : 'X\(//\)$' \| \
+         X"$ac_dest" : 'X\(/\)' \| \
+         .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_dest" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  { if $as_mkdir_p; then
+    mkdir -p "$ac_dest_dir"
+  else
+    as_dir="$ac_dest_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+         X"$as_dir" : 'X\(//\)[^/]' \| \
+         X"$as_dir" : 'X\(//\)$' \| \
+         X"$as_dir" : 'X\(/\)' \| \
+         .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dest_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dest_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+  ac_builddir=.
+
+if test "$ac_dest_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dest_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dest_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dest_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dest_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dest_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dest_dir" && cd $ac_top_srcdir && pwd`
+
+
+  case $srcdir in
+  [\\/$]* | ?:[\\/]* ) ac_rel_source=$srcdir/$ac_source ;;
+      *) ac_rel_source=$ac_top_builddir$srcdir/$ac_source ;;
+  esac
+
+  # Try a symlink, then a hard link, then a copy.
+  ln -s $ac_rel_source $ac_dest 2>/dev/null ||
+    ln $srcdir/$ac_source $ac_dest 2>/dev/null ||
+    cp -p $srcdir/$ac_source $ac_dest ||
+    { { echo "$as_me:$LINENO: error: cannot link or copy $srcdir/$ac_source to $ac_dest" >&5
+echo "$as_me: error: cannot link or copy $srcdir/$ac_source to $ac_dest" >&2;}
+   { (exit 1); exit 1; }; }
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+  ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+         X"$ac_dest" : 'X\(//\)[^/]' \| \
+         X"$ac_dest" : 'X\(//\)$' \| \
+         X"$ac_dest" : 'X\(/\)' \| \
+         .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_dest" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+
+  { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
+echo "$as_me: executing $ac_dest commands" >&6;}
+  case $ac_dest in
+    default-1 ) case "$CONFIG_FILES" in *po/Makefile.in*)
+        sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
+      esac ;;
+    default )
 . $srcdir/configure.lang
 case x$CONFIG_HEADERS in
 xauto-host.h:config.in)
@@ -9206,10 +13822,37 @@
   echo creating libintl.h
   echo '#include "intl/libintl.h"' >libintl.h
 fi
+ ;;
+  esac
+done
+_ACEOF
 
-exit 0
-EOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+{ (exit 0); exit 0; }
+_ACEOF
 chmod +x $CONFIG_STATUS
-rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
 
diff -urNEBb gcc-2.95.3-orig/gcc/configure.in gcc-2.95.3/gcc/configure.in
--- gcc-2.95.3-orig/gcc/configure.in	2001-01-25 15:03:02.000000000 +0100
+++ gcc-2.95.3/gcc/configure.in	2003-12-02 17:50:54.000000000 +0100
@@ -1081,6 +1081,24 @@
 		fi
 		;;
 changequote(,)dnl
+        i[34567]86-*-macosx* | \
+        i[34567]86-*-darwin*)
+changequote([,])dnl
+      		out_file=i386/openstep.c
+      		xm_file=i386/xm-openstep.h
+		xm_defines="SYS_SIGLIST_DECLARED"
+      		tm_file=i386/openstep.h
+      		tmake_file=apple/t-apple
+      		xmake_file=apple/x-darwin
+      		extra_objs=machopic.o
+      		extra_passes=cc1obj
+      		fixincludes=Makefile.in # On NeXT, the headers are ok already.
+      		if [ x$enable_threads = xyes ]; then
+              		thread_file='mach'
+      		fi
+      		makefile_cond="$makefile_cond next-headers"
+      		;;
+changequote(,)dnl
 	i[34567]86-sequent-bsd*) 		# 80386 from Sequent
 changequote([,])dnl
 		use_collect2=yes
@@ -2118,6 +2136,14 @@
 		extra_headers=math-68881.h
 		float_format=m68k
 		;;
+	m68k-*-amigaos*)
+                xm_file=m68k/xm-amigaos.h
+                tm_file=m68k/amigaos.h
+                tmake_file=m68k/t-amigaos
+                xmake_file=m68k/x-amigaos
+                extra_objs=amigaos.o
+                gnu_ld=yes
+                ;;
 
 	m88k-dg-dgux*)
 		case $machine in
@@ -2753,6 +2779,15 @@
 	romp-*-openbsd*)
 		# Nothing special
 		;;
+	powerpc-*-amiga*)
+		cpu_type=rs6000
+		tm_file=rs6000/amigaos.h
+		xm_file=rs6000/xm-amigaos.h
+		tmake_file=rs6000/t-amigaos
+		xmake_file=rs6000/x-amigaos
+		extra_objs=amigaos.o
+        use_collect2=yes
+		;;
 	powerpc-*-openbsd*)
 		tmake_file="${tmake_file} rs6000/t-rs6000 rs6000/t-openbsd"
 		;;
@@ -2841,6 +2876,25 @@
 			thread_file='posix'
 		fi
 		;;
+	powerpc-*-macosx* | powerpc-*-darwin*)
+     	 	cpu_type=rs6000
+      		tm_file=rs6000/macosx.h
+      		out_file=rs6000/macosx.c
+      		xm_file=rs6000/xm-macosx.h
+		xm_defines="SYS_SIGLIST_DECLARED"
+      		tmake_file=rs6000/t-macosx
+      		xmake_file=apple/x-darwin
+      		extra_objs=machopic.o
+      		extra_passes=cc1obj
+      		fixincludes=Makefile.in # On NeXT, the headers are ok already.
+      		makefile_conf="$makefile_cond next-headers"
+      		;;
+   	powerpc-*-macos*)
+      		out_file=rs6000/macos.c
+      		tm_file=rs6000/macos.h
+      		tmake_file=rs6000/t-macos
+      		fixincludes=Makefile.in
+      		;;
         powerpc-wrs-vxworks*)
                 cpu_type=rs6000
 		xm_file="xm-siglist.h rs6000/xm-sysv4.h"
diff -urNEBb gcc-2.95.3-orig/gcc/cp/typeck.c gcc-2.95.3/gcc/cp/typeck.c
--- gcc-2.95.3-orig/gcc/cp/typeck.c	1999-08-09 10:46:20.000000000 +0200
+++ gcc-2.95.3/gcc/cp/typeck.c	2003-12-02 17:50:55.000000000 +0100
@@ -3003,6 +3003,14 @@
   /* fntype now gets the type of function pointed to.  */
   fntype = TREE_TYPE (fntype);
 
+  if (lookup_attribute("libcall", TYPE_ATTRIBUTES(fntype))) 
+   if (TREE_CODE(function)==COMPONENT_REF)
+    params = chainon (build_tree_list(NULL_TREE, 
+                                      build1(ADDR_EXPR,build_pointer_type(TREE_TYPE(TREE_OPERAND(function,0))),
+				             TREE_OPERAND(function,0))
+				      )
+		      , params);
+
   /* Convert the parameters to the types declared in the
      function prototype, or apply default promotions.  */
 
diff -urNEBb gcc-2.95.3-orig/gcc/cppfiles.c gcc-2.95.3/gcc/cppfiles.c
--- gcc-2.95.3-orig/gcc/cppfiles.c	1999-05-10 17:24:33.000000000 +0200
+++ gcc-2.95.3/gcc/cppfiles.c	2003-12-02 17:50:55.000000000 +0100
@@ -57,12 +57,23 @@
 #ifdef VMS
 #define INO_T_EQ(a, b) (!bcmp((char *) &(a), (char *) &(b), sizeof (a)))
 #elif (defined _WIN32 && !defined CYGWIN && ! defined (_UWIN)) \
-       || defined __MSDOS__
+       || defined __MSDOS__ || defined __amigaos__
 #define INO_T_EQ(a, b) 0
 #else
 #define INO_T_EQ(a, b) ((a) == (b))
 #endif
 
+#ifdef __amigaos__
+#include <limits.h>
+#endif /* __amigaos__ */
+
+#undef OPEN_CASE_SENSITIVE
+
+#ifndef OPEN_CASE_SENSITIVE
+/* Default is standard open() */
+#define OPEN_CASE_SENSITIVE open
+#endif
+
 /* Merge the four include chains together in the order quote, bracket,
    system, after.  Remove duplicate dirs (as determined by
    INO_T_EQ()).  The system_include and after_include chains are never
@@ -318,7 +329,12 @@
   
   ih = include_hash (pfile, fname, 1);
   jh = redundant_include_p (pfile, ih,
-			    fname[0] == '/' ? ABSOLUTE_PATH : search_start);
+#ifdef FILE_NAME_ABSOLUTE_P
+			    FILE_NAME_ABSOLUTE_P (fname)
+#else
+			    fname[0] == '/'
+#endif
+			    ? ABSOLUTE_PATH : search_start);
 
   if (jh != 0)
     {
@@ -328,7 +344,7 @@
       if (jh == (struct include_hash *)-1)
 	return -2;
       else
-	return open (jh->name, O_RDONLY, 0666);
+	return OPEN_CASE_SENSITIVE (jh->name, O_RDONLY, 0666);
     }
 
   if (ih->foundhere)
@@ -354,11 +370,15 @@
   ih->control_macro = NULL;
   
   /* If the pathname is absolute, just open it. */ 
+#ifdef FILE_NAME_ABSOLUTE_P
+  if (FILE_NAME_ABSOLUTE_P (fname))
+#else
   if (fname[0] == '/')
+#endif
     {
       ih->foundhere = ABSOLUTE_PATH;
       ih->name = ih->nshort;
-      return open (ih->name, O_RDONLY, 0666);
+      return OPEN_CASE_SENSITIVE (ih->name, O_RDONLY, 0666);
     }
 
   /* Search directory path, trying to open the file. */
@@ -369,13 +389,20 @@
   for (l = search_start; l; l = l->next)
     {
       bcopy (l->name, name, l->nlen);
+#ifdef VOL_SEPARATOR
+      if (name[l->nlen - 1] == VOL_SEPARATOR)
+	strcpy (&name[l->nlen], fname);
+      else
+#endif
+  {
       name[l->nlen] = '/';
       strcpy (&name[l->nlen+1], fname);
+  }
       simplify_pathname (name);
       if (CPP_OPTIONS (pfile)->remap)
 	name = remap_filename (pfile, name, l);
 
-      f = open (name, O_RDONLY|O_NONBLOCK|O_NOCTTY, 0666);
+      f = OPEN_CASE_SENSITIVE (name, O_RDONLY|O_NONBLOCK|O_NOCTTY, 0666);
 #ifdef EACCES
       if (f == -1 && errno == EACCES)
 	{
@@ -723,6 +750,18 @@
   
   dir = xstrdup (fname);
   last_slash = rindex (dir, '/');
+
+#ifdef VOL_SEPARATOR
+  {
+    char *last_sep;
+    last_sep = rindex (dir, VOL_SEPARATOR);
+    if (last_sep)
+      last_sep++; /* Keep VOL_SEPARATOR.  */
+    if (last_sep > last_slash)
+      last_slash = last_sep;
+  }
+#endif
+
   if (last_slash)
     {
       if (last_slash == dir)
diff -urNEBb gcc-2.95.3-orig/gcc/doprint.c gcc-2.95.3/gcc/doprint.c
--- gcc-2.95.3-orig/gcc/doprint.c	1999-01-06 21:44:19.000000000 +0100
+++ gcc-2.95.3/gcc/doprint.c	2003-12-02 17:50:55.000000000 +0100
@@ -16,7 +16,6 @@
 along with this program; if not, write to the Free Software
 Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
- */
 
 #include "config.h"
 #include "system.h"
@@ -114,6 +113,7 @@
 		  wide_width = 2;
 		  break;
 		default:
+			#undef abort
 		  abort();
 		}
 	      *sptr++ = *ptr++;
diff -urNEBb gcc-2.95.3-orig/gcc/f/version.c gcc-2.95.3/gcc/f/version.c
--- gcc-2.95.3-orig/gcc/f/version.c	2001-03-16 13:52:16.000000000 +0100
+++ gcc-2.95.3/gcc/f/version.c	2003-12-02 17:50:55.000000000 +0100
@@ -1 +1 @@
-const char *ffe_version_string = "0.5.25 20010315 (release)";
+const char *ffe_version_string = "0.5.25 20010315 (Amiga, Inc. build 20030831)";
diff -urNEBb gcc-2.95.3-orig/gcc/fixinc/fixincl.c gcc-2.95.3/gcc/fixinc/fixincl.c
--- gcc-2.95.3-orig/gcc/fixinc/fixincl.c	1999-06-07 22:26:07.000000000 +0200
+++ gcc-2.95.3/gcc/fixinc/fixincl.c	2003-12-02 17:50:55.000000000 +0100
@@ -345,10 +345,12 @@
       */
   run_compiles ();
 
+#ifndef __amigaos4__
   signal (SIGQUIT, SIG_IGN);
   signal (SIGIOT,  SIG_IGN);
   signal (SIGPIPE, SIG_IGN);
   signal (SIGALRM, SIG_IGN);
+#endif
   signal (SIGTERM, SIG_IGN);
 
   /*
diff -urNEBb gcc-2.95.3-orig/gcc/fixinc/server.c gcc-2.95.3/gcc/fixinc/server.c
--- gcc-2.95.3-orig/gcc/fixinc/server.c	1999-05-30 15:45:17.000000000 +0200
+++ gcc-2.95.3/gcc/fixinc/server.c	2003-12-02 17:50:55.000000000 +0100
@@ -180,7 +180,11 @@
 {
   if (server_id != NULLPROCESS)
     {
+#ifdef __amigaos4__
+      kill ((pid_t) server_id, SIGTERM);
+#else
       kill ((pid_t) server_id, SIGKILL);
+#endif
       server_id = NULLPROCESS;
       fclose (server_pair.pf_read);
       fclose (server_pair.pf_write);
@@ -222,8 +226,10 @@
   if (atexit_done++ == 0)
     atexit (&close_server);
 
+#ifndef __amigaos4__
   signal (SIGPIPE, sig_handler);
   signal (SIGALRM, sig_handler);
+#endif
 
   fputs ("trap : 1\n", server_pair.pf_write);
   fflush (server_pair.pf_write);
diff -urNEBb gcc-2.95.3-orig/gcc/genattrtab.c gcc-2.95.3/gcc/genattrtab.c
--- gcc-2.95.3-orig/gcc/genattrtab.c	1999-04-16 21:52:21.000000000 +0200
+++ gcc-2.95.3/gcc/genattrtab.c	2003-12-02 17:50:55.000000000 +0100
@@ -104,6 +104,10 @@
 # include <sys/resource.h>
 #endif
 
+#ifdef __amigaos__
+#include <limits.h>
+#endif /* __amigaos__ */
+
 /* We must include obstack.h after <sys/time.h>, to avoid lossage with
    /usr/include/sys/stdtypes.h on Sun OS 4.x.  */
 #include "obstack.h"
diff -urNEBb gcc-2.95.3-orig/gcc/getpwd.c gcc-2.95.3/gcc/getpwd.c
--- gcc-2.95.3-orig/gcc/getpwd.c	1998-12-16 21:56:28.000000000 +0100
+++ gcc-2.95.3/gcc/getpwd.c	2003-12-02 17:50:55.000000000 +0100
@@ -7,7 +7,7 @@
    BSD systems) now provides getcwd as called for by POSIX.  Allow for
    the few exceptions to the general rule here.  */
 
-#if !(defined (POSIX) || defined (USG) || defined (VMS)) || defined (HAVE_GETWD)
+#if !(defined (POSIX) || defined (USG) || defined (VMS) || defined(__amigaos__)) || defined (HAVE_GETWD)
 #define getcwd(buf,len) getwd(buf)
 #ifdef MAXPATHLEN
 #define GUESSPATHLEN (MAXPATHLEN + 1)
diff -urNEBb gcc-2.95.3-orig/gcc/ginclude/va-ppc.h gcc-2.95.3/gcc/ginclude/va-ppc.h
--- gcc-2.95.3-orig/gcc/ginclude/va-ppc.h	1999-08-09 07:55:16.000000000 +0200
+++ gcc-2.95.3/gcc/ginclude/va-ppc.h	2003-12-02 17:50:55.000000000 +0100
@@ -190,6 +190,20 @@
   __ptr;								   \
 }))
 
+
+#if defined(__AMIGA__) && defined (__PPC__)
+
+/* OS4 linear vararg support */
+#define va_startlinear(AP, x)			\
+           va_start(AP, x);			\
+           (AP)->gpr = 8;			\
+           (AP)->fpr = 8;
+
+#define va_getlinearva(AP,TYPE)                 \
+           (TYPE)__va_overflow(AP)
+
+#endif
+
 #define va_end(AP)	((void)0)
 
 /* Copy __gnuc_va_list into another variable of this type.  */
diff -urNEBb gcc-2.95.3-orig/gcc/intl/dcgettext.c gcc-2.95.3/gcc/intl/dcgettext.c
--- gcc-2.95.3-orig/gcc/intl/dcgettext.c	1998-12-17 07:45:44.000000000 +0100
+++ gcc-2.95.3/gcc/intl/dcgettext.c	2003-12-02 17:50:55.000000000 +0100
@@ -18,7 +18,7 @@
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
-
+#define HAVE_GETCWD
 #include <sys/types.h>
 
 #ifdef __GNUC__
@@ -99,6 +99,7 @@
 char *getwd ();
 #  define getcwd(buf, max) getwd (buf)
 # else
+#undef getcwd
 char *getcwd ();
 # endif
 # ifndef HAVE_STPCPY
diff -urNEBb gcc-2.95.3-orig/gcc/libgcc2.c gcc-2.95.3/gcc/libgcc2.c
--- gcc-2.95.3-orig/gcc/libgcc2.c	1999-06-11 05:11:43.000000000 +0200
+++ gcc-2.95.3/gcc/libgcc2.c	2003-12-02 17:50:55.000000000 +0100
@@ -60,9 +60,9 @@
 /* In a cross-compilation situation, default to inhibiting compilation
    of routines that use libc.  */
 
-#if defined(CROSS_COMPILE) && !defined(inhibit_libc)
+/*#if defined(CROSS_COMPILE) && !defined(inhibit_libc)
 #define inhibit_libc
-#endif
+#endif*/
 
 /* Permit the tm.h file to select the endianness to use just for this
    file.  This is used when the endianness is determined when the
diff -urNEBb gcc-2.95.3-orig/gcc/protoize.c gcc-2.95.3/gcc/protoize.c
--- gcc-2.95.3-orig/gcc/protoize.c	1999-04-16 21:52:36.000000000 +0200
+++ gcc-2.95.3/gcc/protoize.c	2003-12-02 17:50:55.000000000 +0100
@@ -62,7 +62,7 @@
 #undef abort
 
 #if ! defined (_WIN32) || defined (__CYGWIN__) || defined (_UWIN)
-#if defined(POSIX) || defined(CONCURRENT)
+#if defined(POSIX) || defined(CONCURRENT) || defined(__amigaos__)
 #include <dirent.h>
 #else
 #include <sys/dir.h>
diff -urNEBb gcc-2.95.3-orig/gcc/toplev.c gcc-2.95.3/gcc/toplev.c
--- gcc-2.95.3-orig/gcc/toplev.c	2001-01-25 15:03:23.000000000 +0100
+++ gcc-2.95.3/gcc/toplev.c	2003-12-02 17:50:55.000000000 +0100
@@ -139,7 +139,7 @@
 
 extern int rtx_equal_function_value_matters;
 
-#if ! (defined (VMS) || defined (OS2))
+#if ! (defined (VMS) || defined (OS2) || defined(__amigaos4__))
 extern char **environ;
 #endif
 extern char *version_string, *language_string;
@@ -924,6 +924,10 @@
   {"pic", &flag_pic, 1,
    "Generate position independent code, if possible"},
   {"PIC", &flag_pic, 2, ""},
+  {"baserel", &flag_pic, 3,
+   "Generate base relative code"},
+  {"baserel32", &flag_pic, 4,
+   "Generate base relative code with no data limits"},
   {"exceptions", &flag_exceptions, 1,
    "Enable exception handling" },
   {"new-exceptions", &flag_new_exceptions, 1,
@@ -1336,6 +1340,9 @@
   if (quiet_flag)
     return 0;
 
+#ifdef __amigaos__
+  return 0;
+#else
 #ifdef __BEOS__
   return 0;
 #else /* not BeOS */
@@ -1395,6 +1402,7 @@
 #endif  /* _SC_CLK_TCK */
 #endif	/* _WIN32 */
 #endif	/* __BEOS__ */
+#endif  /* __amigaos__ */
 }
 
 #define TIMEVAR(VAR, BODY)    \
@@ -2569,7 +2577,11 @@
   /* NA gets INPUT_NAME sans directory names.  */
   while (na > input_name)
     {
-      if (na[-1] == '/')
+      if (na[-1] == '/'
+#ifdef VOL_SEPARATOR
+	  || na[-1] == VOL_SEPARATOR
+#endif
+	  )
 	break;
 #ifdef DIR_SEPARATOR
       if (na[-1] == DIR_SEPARATOR)
@@ -4776,6 +4788,9 @@
 #ifdef DIR_SEPARATOR
 	 && p[-1] != DIR_SEPARATOR
 #endif
+#ifdef VOL_SEPARATOR
+	 && p[-1] != VOL_SEPARATOR
+#endif
 	 )
     --p;
   progname = p;
@@ -5449,7 +5464,7 @@
 
   compile_file (filename);
 
-#if !defined(OS2) && !defined(VMS) && (!defined(_WIN32) || defined (__CYGWIN__)) && !defined(__INTERIX)
+#if !defined(OS2) && !defined(VMS) && (!defined(_WIN32) || defined (__CYGWIN__)) && !defined(__INTERIX) && !defined (__amigaos__)
   if (flag_print_mem)
     {
       char *lim = (char *) sbrk (0);
@@ -5465,7 +5480,7 @@
 #endif /* not USG */
 #endif
     }
-#endif /* ! OS2 && ! VMS && (! _WIN32 || CYGWIN) && ! __INTERIX */
+#endif /* ! OS2 && ! VMS && (! _WIN32 || CYGWIN) && ! __INTERIX && ! __amigaos__*/
 
   if (errorcount)
     exit (FATAL_EXIT_CODE);
diff -urNEBb gcc-2.95.3-orig/gcc/version.c gcc-2.95.3/gcc/version.c
--- gcc-2.95.3-orig/gcc/version.c	2001-03-16 13:52:12.000000000 +0100
+++ gcc-2.95.3/gcc/version.c	2003-12-02 17:50:55.000000000 +0100
@@ -1 +1 @@
-char *version_string = "2.95.3 20010315 (release)";
+char *version_string = "2.95.3 20010315 (Amiga, Inc. build 20030831)";
diff -urNEBb gcc-2.95.3-orig/libiberty/choose-temp.c gcc-2.95.3/libiberty/choose-temp.c
--- gcc-2.95.3-orig/libiberty/choose-temp.c	1999-04-25 02:23:06.000000000 +0200
+++ gcc-2.95.3/libiberty/choose-temp.c	2003-12-02 17:50:55.000000000 +0100
@@ -26,6 +26,8 @@
 #include "config.h"
 #endif
 
+#undef HAVE_SYS_FILE_H
+
 #include <stdio.h>	/* May get P_tmpdir.  */
 #include <sys/types.h>
 #ifdef HAVE_UNISTD_H
@@ -51,6 +53,9 @@
 #if defined (__MSDOS__) || (defined (_WIN32) && ! defined (__CYGWIN__) && ! defined (_UWIN))
 #define DIR_SEPARATOR '\\'
 #endif
+#ifdef __amigaos__
+#define VOL_SEPARATOR ':'
+#endif
 #endif
 
 #ifndef DIR_SEPARATOR
@@ -117,7 +122,9 @@
 #endif
 
   /* Try /usr/tmp, then /tmp.  */
+  #if !defined(__amigaos__)
   base = try (usrtmp, base);
+  #endif
   base = try (tmp, base);
  
   /* If all else fails, use the current directory!  */
@@ -131,7 +138,11 @@
 
   if (len != 0
       && temp_filename[len-1] != '/'
-      && temp_filename[len-1] != DIR_SEPARATOR)
+      && temp_filename[len-1] != DIR_SEPARATOR
+#ifdef VOL_SEPARATOR
+      && temp_filename[len-1] != VOL_SEPARATOR
+#endif
+      )
     temp_filename[len++] = DIR_SEPARATOR;
   strcpy (temp_filename + len, TEMP_FILE);
 
diff -urNEBb gcc-2.95.3-orig/libiberty/getcwd.c gcc-2.95.3/libiberty/getcwd.c
--- gcc-2.95.3-orig/libiberty/getcwd.c	1999-05-26 05:04:08.000000000 +0200
+++ gcc-2.95.3/libiberty/getcwd.c	2003-12-02 17:50:55.000000000 +0100
@@ -25,6 +25,8 @@
 
 #include "config.h"
 
+#undef HAVE_SYS_PARAM_H
+
 #ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
 #endif
diff -urNEBb gcc-2.95.3-orig/libiberty/getpagesize.c gcc-2.95.3/libiberty/getpagesize.c
--- gcc-2.95.3-orig/libiberty/getpagesize.c	1998-05-21 09:52:39.000000000 +0200
+++ gcc-2.95.3/libiberty/getpagesize.c	2003-12-02 17:50:55.000000000 +0100
@@ -30,6 +30,8 @@
 
 #include "config.h"
 
+#undef HAVE_SYS_PARAM_H
+
 #include <sys/types.h>
 #ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
diff -urNEBb gcc-2.95.3-orig/libiberty/pexecute.c gcc-2.95.3/libiberty/pexecute.c
--- gcc-2.95.3-orig/libiberty/pexecute.c	1999-04-12 00:21:27.000000000 +0200
+++ gcc-2.95.3/libiberty/pexecute.c	2003-12-02 17:50:55.000000000 +0100
@@ -116,7 +116,7 @@
    runs the requested programs.
 */
 
-#ifdef __MSDOS__
+#if defined(__MSDOS__) && !defined(__amigaos__)
 
 /* MSDOS doesn't multitask, but for the sake of a consistent interface
    the code behaves like it does.  pexecute runs the program, tucks the
@@ -230,7 +230,7 @@
 
 #endif /* MSDOS */
 
-#if defined (_WIN32) && ! defined (_UWIN)
+#if defined (_WIN32) && ! defined (_UWIN) && !defined(__amigaos__)
 
 #include <process.h>
 
@@ -602,7 +602,7 @@
 
 /* include for Unix-like environments but not for Dos-like environments */
 #if ! defined (__MSDOS__) && ! defined (OS2) && ! defined (MPW) \
-    && ! (defined (_WIN32) && ! defined (_UWIN))
+    && ! (defined (_WIN32) && ! defined (_UWIN)) && ! defined(__amigaos__)
 
 extern int execv ();
 extern int execvp ();
@@ -732,3 +732,126 @@
 }
 
 #endif /* ! __MSDOS__ && ! OS2 && ! MPW && ! (_WIN32 && ! _UWIN) */
+
+#if defined(__amigaos__)
+
+/* For communicating information from pexecute to pwait.  */
+static int last_pid = 0;
+static int last_status = 0;
+static int last_reaped = 0;
+
+int
+pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
+     const char *program;
+     char * const *argv;
+     const char *this_pname;
+     const char *temp_base;
+     char **errmsg_fmt, **errmsg_arg;
+     int flags;
+{
+  int rc;
+  char *scmd,*s;
+  int i,j,c,len,arglen;
+  int need_quote;
+
+  last_pid++;
+  if (last_pid < 0)
+    last_pid = 1;
+
+  if ((flags & PEXECUTE_ONE) != PEXECUTE_ONE)
+    abort ();
+
+  len = 0;
+
+  for(i = 0 ; argv[i] != NULL ; i++)
+  {
+    arglen = strlen(argv[i]);
+
+    len += 1 + arglen;
+
+    for(j = 0, need_quote = 0 ; j < arglen ; j++)
+    {
+      c = argv[i][j];
+
+      if(isspace(c))
+        need_quote = 1;
+      else if (c == '\"')
+        len++;
+    }
+
+    if(need_quote)
+      len += 2;
+  }
+
+  s = scmd = (char *) xmalloc (len+1);
+
+  for(i = 0 ; argv[i] != NULL ; i++)
+  {
+    arglen = strlen(argv[i]);
+
+    for(j = 0, need_quote = 0 ; j < arglen ; j++)
+    {
+      if(isspace(argv[i][j]))
+        need_quote = 1;
+    }
+
+    if(s != scmd)
+      (*s++) = ' ';
+
+    if(need_quote)
+      (*s++) = '\"';
+
+    for(j = 0 ; j < arglen ; j++)
+    {
+      c = argv[i][j];
+      if(c == '\"')
+        (*s++) = '*';
+
+      (*s++) = c;
+    }
+
+    if(need_quote)
+      (*s++) = '\"';
+  }
+
+  (*s) = '\0';
+
+  rc = system (scmd);
+
+  free (scmd);
+
+  if (rc == -1)
+    {
+      *errmsg_fmt = install_error_msg;
+      *errmsg_arg = program;
+      return -1;
+    }
+
+  /* Tuck the status away for pwait, and return a "pid".  */
+  last_status = rc << 8;
+  return last_pid;
+}
+
+int
+pwait (pid, status, flags)
+     int pid;
+     int *status;
+     int flags;
+{
+  /* On MSDOS each pexecute must be followed by it's associated pwait.  */
+  if (pid != last_pid
+      /* Called twice for the same child?  */
+      || pid == last_reaped)
+    {
+      /* ??? ECHILD would be a better choice.  Can we use it here?  */
+      errno = EINVAL;
+      return -1;
+    }
+  /* ??? Here's an opportunity to canonicalize the values in STATUS.
+     Needed?  */
+  *status = last_status;
+  last_reaped = last_pid;
+  return last_pid;
+}
+
+#endif /* __amigaos__ */
diff -urNEBb gcc-2.95.3-orig/libiberty/strerror.c gcc-2.95.3/libiberty/strerror.c
--- gcc-2.95.3-orig/libiberty/strerror.c	1998-05-16 01:42:41.000000000 +0200
+++ gcc-2.95.3/libiberty/strerror.c	2003-12-03 13:59:53.000000000 +0100
@@ -462,7 +462,7 @@
 
 #else
 
-extern int sys_nerr;
+/*extern const int sys_nerr;*/
 extern char *sys_errlist[];
 
 #endif
diff -urNEBb gcc-2.95.3-orig/libiberty/strsignal.c gcc-2.95.3/libiberty/strsignal.c
--- gcc-2.95.3-orig/libiberty/strsignal.c	1998-05-16 01:42:42.000000000 +0200
+++ gcc-2.95.3/libiberty/strsignal.c	2003-12-02 17:50:55.000000000 +0100
@@ -7,6 +7,8 @@
 
 #include "config.h"
 
+#undef HAVE_SYS_SIGLIST
+
 /* We need to declare sys_siglist, because even if the system provides
    it we can't assume that it is declared in <signal.h> (for example,
    SunOS provides sys_siglist, but it does not declare it in any
@@ -370,6 +372,8 @@
 
 */
 
+#if !defined(__amigaos__)
+
 int
 signo_max ()
 {
@@ -383,6 +387,7 @@
   return (maxsize - 1);
 }
 
+#endif /* __amigaos__ */
 
 /*
 
@@ -414,6 +419,7 @@
 
 */
 
+#if !defined(__amigaos__)
 #ifndef HAVE_STRSIGNAL
 
 const char *
@@ -453,6 +459,7 @@
 }
 
 #endif /* ! HAVE_STRSIGNAL */
+#endif /* __amigaos__ */
 
 /*
 
diff -urNEBb gcc-2.95.3-orig/libiberty/vasprintf.c gcc-2.95.3/libiberty/vasprintf.c
--- gcc-2.95.3-orig/libiberty/vasprintf.c	1998-09-07 22:37:12.000000000 +0200
+++ gcc-2.95.3/libiberty/vasprintf.c	2003-12-02 17:50:55.000000000 +0100
@@ -31,6 +31,8 @@
 int global_total_width;
 #endif
 
+#undef vasprintf
+
 unsigned long strtoul ();
 char *malloc ();
 
diff -urNEBb gcc-2.95.3-orig/libiberty/vsprintf.c gcc-2.95.3/libiberty/vsprintf.c
--- gcc-2.95.3-orig/libiberty/vsprintf.c	1998-05-16 01:14:55.000000000 +0200
+++ gcc-2.95.3/libiberty/vsprintf.c	2003-12-02 17:50:55.000000000 +0100
@@ -37,6 +37,7 @@
      const char *format;
      va_list ap;
 {
+#if 0
   FILE b;
   int ret;
 #ifdef VMS
@@ -51,5 +52,5 @@
   ret = _doprnt(format, ap, &b);
   putc('\0', &b);
   return ret;
-
+#endif
 }
diff -urNEBb gcc-2.95.3-orig/libio/#iostream.cc# gcc-2.95.3/libio/#iostream.cc#
--- gcc-2.95.3-orig/libio/#iostream.cc#	1970-01-01 01:00:00.000000000 +0100
+++ gcc-2.95.3/libio/#iostream.cc#	2003-12-02 17:50:55.000000000 +0100
@@ -0,0 +1,1050 @@
+/* This is part of libio/iostream, providing -*- C++ -*- input/output.
+   Copyright (C) 1993, 1997, 2000 Free Software Foundation, Inc.
+
+   This file is part of the GNU IO Library.  This library is free
+   software; you can redistribute it and/or modify it under the
+   terms of the GNU General Public License as published by the
+   Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this library; see the file COPYING.  If not, write to the Free
+   Software Foundation, 59 Temple Place - Suite 330, Boston, MA  02111-1307,
+   USA.
+
+   As a special exception, if you link this library with files
+   compiled with a GNU compiler to produce an executable, this does not cause
+   the resulting executable to be covered by the GNU General Public License.
+   This exception does not however invalidate any other reasons why
+   the executable file might be covered by the GNU General Public License. */
+
+/* Written by Per Bothner (bothner@cygnus.com). */
+
+#ifdef __GNUC__
+#pragma implementation
+#endif
+#define _STREAM_COMPAT
+#include <iostream.h>
+#include "libioP.h"
+#include <stdio.h>  /* Needed for sprintf */
+#include <ctype.h>
+#include <string.h>
+#include <limits.h>
+
+
+#if _G_HAVE_PRINTF_FP
+#include <printf.h>
+extern "C" int __printf_fp (_IO_FILE *, const struct printf_info *,
+			    const void *const *);
+#else
+#include "floatio.h"
+# ifndef _IO_USE_DTOA
+int __cvt_double(double number, register int prec, int flags, int *signp,
+                 int fmtch, char *startp, char *endp);
+# endif
+#endif
+
+#define	BUF		(MAXEXP+MAXFRACT+1)	/* + decimal point */
+
+//#define isspace(ch) ((ch)==' ' || (ch)=='\t' || (ch)=='\n')
+
+istream::istream(streambuf *sb, ostream* tied)
+{
+  init (sb, tied);
+  _gcount = 0;
+}
+
+int skip_ws(streambuf* sb)
+{
+    int ch;
+    for (;;) {
+	ch = sb->sbumpc();
+	if (ch == EOF || !isspace(ch))
+	    return ch;
+    }
+}
+
+istream& istream::get(char& c)
+{
+    if (ipfx1()) {
+	_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
+				  _strbuf);
+	int ch = _strbuf->sbumpc();
+	if (ch == EOF) {
+	  set(ios::eofbit|ios::failbit);
+	  _gcount = 0;
+	}
+	else {
+	  c = (char)ch;
+	  _gcount = 1;
+	}
+	isfx();
+	_IO_cleanup_region_end (0);
+    }
+    else
+      _gcount = 0;
+    return *this;
+}
+
+int istream::peek()
+{
+  if (!good())
+    return EOF;
+  if (_tie && rdbuf()->in_avail() == 0)
+    _tie->flush();
+  int ch = _strbuf->sgetc();
+  if (ch == EOF)
+    set(ios::eofbit);
+  return ch;
+}
+
+istream& istream::ignore(int n /* = 1 */, int delim /* = EOF */)
+{
+    _gcount = 0;
+    if (ipfx1()) {
+	_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
+				  _strbuf);
+	register streambuf* sb = _strbuf;
+	if (delim == EOF) {
+	    _gcount = sb->ignore(n);
+	    goto unlock;
+	}
+	for (;;) {
+#if 0
+	    if (n != MAXINT) // FIXME
+#endif
+	    if (--n < 0)
+		break;
+	    int ch = sb->sbumpc();
+	    if (ch == EOF) {
+		set(ios::eofbit|ios::failbit);
+		break;
+	    }
+	    _gcount++;
+	    if (ch == delim)
+		break;
+	}
+    unlock:
+	isfx();
+	_IO_cleanup_region_end (0);
+    }
+    return *this;
+}
+
+istream& istream::read(char *s, streamsize n)
+{
+    if (ipfx1()) {
+	_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
+				  _strbuf);
+	_gcount = _strbuf->sgetn(s, n);
+	if (_gcount != n)
+	    set(ios::failbit|ios::eofbit);
+	isfx();
+	_IO_cleanup_region_end (0);
+    }
+    else
+      _gcount = 0;
+    return *this;
+}
+
+int
+istream::sync ()
+{
+  streambuf *sb = rdbuf ();
+  if (sb == NULL)
+    return EOF;
+  if (sb->sync ()) // Later: pubsync
+    {
+      setstate (ios::badbit);
+      return EOF;
+    }
+  else
+    return 0;
+}
+
+istream& istream::seekg(streampos pos)
+{
+    pos = _strbuf->pubseekpos(pos, ios::in);
+    if (pos == streampos(EOF))
+	set(ios::badbit);
+    return *this;
+}
+
+istream& istream::seekg(streamoff off, _seek_dir dir)
+{
+  streampos pos = _IO_seekoff (_strbuf, off, (int) dir, _IOS_INPUT);
+  if (pos == streampos(EOF))
+    set(ios::badbit);
+  return *this;
+}
+
+streampos istream::tellg()
+{
+#if 0
+    streampos pos = _strbuf->pubseekoff(0, ios::cur, ios::in);
+#else
+    streampos pos = _IO_seekoff (_strbuf, 0, _IO_seek_cur, _IOS_INPUT);
+#endif
+    if (pos == streampos(EOF))
+	set(ios::badbit);
+    return pos;
+}
+
+istream& istream::operator>>(char& c)
+{
+    if (ipfx0()) {
+	_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
+				  _strbuf);
+	int ch = _strbuf->sbumpc();
+	if (ch == EOF)
+	    set(ios::eofbit|ios::failbit);
+	else
+	    c = (char)ch;
+	isfx();
+	_IO_cleanup_region_end (0);
+    }
+    return *this;
+}
+
+istream&
+istream::operator>> (char* ptr)
+{
+  register char *p = ptr;
+  int w = width(0);
+  if (ipfx0())
+    {
+      _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
+				_strbuf);
+      register streambuf* sb = _strbuf;
+      for (;;)
+	{
+	  int ch = sb->sbumpc();
+	  if (ch == EOF)
+	    {
+	      set(ios::eofbit);
+	      break;
+	    }
+	  else if (isspace(ch) || w == 1)
+	    {
+	      sb->sputbackc(ch);
+	      break;
+	    }
+	  else *p++ = ch;
+	  w--;
+	}
+      if (p == ptr)
+	set(ios::failbit);
+      isfx();
+      _IO_cleanup_region_end (0);
+    }
+  *p = '\0';
+  return *this;
+}
+
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+#define LONGEST long long
+#else
+#define LONGEST long
+#endif
+
+static int read_int(istream& stream, unsigned LONGEST& val, int& neg)
+{
+    if (!stream.ipfx0())
+      return 0;
+    int retval;
+    _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
+			      stream._strbuf);
+    register streambuf* sb = stream.rdbuf();
+    int base = 10;
+    int ndigits = 0;
+    register int ch = skip_ws(sb);
+    if (ch == EOF)
+	goto eof_fail;
+    neg = 0;
+    if (ch == '+') {
+	ch = skip_ws(sb);
+    }
+    else if (ch == '-') {
+	neg = 1;
+	ch = skip_ws(sb);
+    }
+    if (ch == EOF) goto eof_fail;
+    if (!(stream.flags() & ios::basefield)) {
+	if (ch == '0') {
+	    ch = sb->sbumpc();
+	    if (ch == EOF) {
+		val = 0;
+		goto unlock;
+	    }
+	    if (ch == 'x' || ch == 'X') {
+		base = 16;
+		ch = sb->sbumpc();
+		if (ch == EOF) goto eof_fail;
+	    }
+	    else {
+		sb->sputbackc(ch);
+		base = 8;
+		ch = '0';
+	    }
+	}
+    }
+    else if ((stream.flags() & ios::basefield) == ios::hex)
+	base = 16;
+    else if ((stream.flags() & ios::basefield) == ios::oct)
+	base = 8;
+    val = 0;
+    for (;;) {
+	if (ch == EOF)
+	    break;
+	int digit;
+	if (ch >= '0' && ch <= '9')
+	    digit = ch - '0';
+	else if (ch >= 'A' && ch <= 'F')
+	    digit = ch - 'A' + 10;
+	else if (ch >= 'a' && ch <= 'f')
+	    digit = ch - 'a' + 10;
+	else
+	    digit = 999;
+	if (digit >= base) {
+	    sb->sputbackc(ch);
+	    if (ndigits == 0)
+		goto fail;
+	    else
+		goto unlock;
+	}
+	ndigits++;
+	val = base * val + digit;
+	ch = sb->sbumpc();
+    }
+  unlock:
+    retval = 1;
+    goto out;
+  fail:
+    stream.set(ios::failbit);
+    retval = 0;
+    goto out;
+  eof_fail:
+    stream.set(ios::failbit|ios::eofbit);
+    retval = 0;
+  out:
+    stream.isfx();
+    _IO_cleanup_region_end (0);
+    return retval;
+}
+
+#define READ_INT(TYPE) \
+istream& istream::operator>>(TYPE& i)\
+{\
+    unsigned LONGEST val; int neg;\
+    if (read_int(*this, val, neg)) {\
+	if (neg) val = -val;\
+	i = (TYPE)val;\
+    }\
+    return *this;\
+}
+
+READ_INT(short)
+READ_INT(unsigned short)
+READ_INT(int)
+READ_INT(unsigned int)
+READ_INT(long)
+READ_INT(unsigned long)
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+READ_INT(long long)
+READ_INT(unsigned long long)
+#endif
+#if _G_HAVE_BOOL
+READ_INT(bool)
+#endif
+
+istream& istream::operator>>(long double& x)
+{
+    if (ipfx0())
+      {
+	_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
+				  _strbuf);
+#if _G_HAVE_LONG_DOUBLE_IO
+	scan("%Lg", &x);
+#else
+	double y;
+	scan("%lg", &y);
+	x = y;
+#endif
+	isfx();
+	_IO_cleanup_region_end (0);
+      }
+    return *this;
+}
+
+istream& istream::operator>>(double& x)
+{
+    if (ipfx0())
+      {
+	_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
+				  _strbuf);
+	scan("%lg", &x);
+	isfx();
+	_IO_cleanup_region_end (0);
+      }
+    return *this;
+}
+
+istream& istream::operator>>(float& x)
+{
+    if (ipfx0())
+      {
+	_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
+				  _strbuf);
+	scan("%g", &x);
+	isfx();
+	_IO_cleanup_region_end (0);
+      }
+    return *this;
+}
+
+istream& istream::operator>>(register streambuf* sbuf)
+{
+    if (ipfx0()) {
+	_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
+				  _strbuf);
+	register streambuf* inbuf = rdbuf();
+	// FIXME: Should optimize!
+	for (;;) {
+	    register int ch = inbuf->sbumpc();
+	    if (ch == EOF) {
+		set(ios::eofbit);
+		break;
+	    }
+	    if (sbuf->sputc(ch) == EOF) {
+		set(ios::failbit);
+		break;
+	    }
+	}
+	isfx();
+	_IO_cleanup_region_end (0);
+    }
+    return *this;
+}
+
+ostream& ostream::operator<<(char c)
+{
+    if (opfx()) {
+	_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
+				  _strbuf);
+#if 1
+	// This is what the cfront implementation does.
+	if (_strbuf->sputc(c) == EOF) {
+	    set(ios::badbit);
+	    goto failed;
+	}
+#else
+	// This is what cfront documentation and current ANSI drafts say.
+	int w = width(0);
+	char fill_char = fill();
+	register int padding = w > 0 ? w - 1 : 0;
+	register streambuf *sb = _strbuf;
+	if (!(flags() & ios::left) && padding) // Default adjustment.
+	    if (_IO_padn(sb, fill_char, padding) < padding) {
+	      set(ios::badbit);
+	      goto failed;
+	    }
+	if (sb->sputc(c) == EOF) {
+	  set(ios::badbit);
+	  goto failed;
+        }
+	if (flags() & ios::left && padding) // Left adjustment.
+	    if (_IO_padn(sb, fill_char, padding) < padding)
+	      set(ios::badbit);
+#endif
+       failed:
+	osfx();
+	_IO_cleanup_region_end (0);
+    }
+    return *this;
+}
+
+/* Write VAL on STREAM.
+   If SIGN<0, val is the absolute value of a negative number.
+   If SIGN>0, val is a signed non-negative number.
+   If SIGN==0, val is unsigned. */
+
+static void write_int(ostream& stream, unsigned LONGEST val, int sign)
+{
+#define WRITE_BUF_SIZE (10 + sizeof(unsigned LONGEST) * 3)
+    char buf[WRITE_BUF_SIZE];
+    register char *buf_ptr = buf+WRITE_BUF_SIZE; // End of buf.
+    const char *show_base = "";
+    int show_base_len = 0;
+    int show_pos = 0; // If 1, print a '+'.
+
+    // Now do the actual conversion, placing the result at the *end* of buf.
+    // Note that we use separate code for decimal, octal, and hex,
+    // so we can divide by optimizable constants.
+    if ((stream.flags() & ios::basefield) == ios::oct) { // Octal
+	do {
+	    *--buf_ptr = (val & 7) + '0';
+	    val = val >> 3;
+	} while (val != 0);
+	if ((stream.flags() & ios::showbase) && (*buf_ptr != '0'))
+	    *--buf_ptr = '0';
+    }
+    else if ((stream.flags() & ios::basefield) == ios::hex) { // Hex
+	const char *xdigs = (stream.flags() & ios::uppercase) ? "0123456789ABCDEF0X"
+	    : "0123456789abcdef0x";
+	do {
+	    *--buf_ptr = xdigs[val & 15];
+	    val = val >> 4;
+	} while (val != 0);
+	if ((stream.flags() & ios::showbase)) {
+	    show_base = xdigs + 16; // Either "0X" or "0x".
+	    show_base_len = 2;
+	}
+    }
+    else { // Decimal
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+	// Optimization:  Only use long long when we need to.
+	while (val > UINT_MAX) {
+	    *--buf_ptr = (val % 10) + '0';
+	    val /= 10;
+	}
+	// Use more efficient (int) arithmetic for the rest.
+	register unsigned int ival = (unsigned int)val;
+#else
+	register unsigned LONGEST ival = val;
+#endif
+	do {
+	    *--buf_ptr = (ival % 10) + '0';
+	    ival /= 10;
+	} while (ival != 0);
+	if (sign > 0 && (stream.flags() & ios::showpos))
+	    show_pos=1;
+    }
+
+    int buf_len = buf+WRITE_BUF_SIZE - buf_ptr;
+    int w = stream.width(0);
+
+    // Calculate padding.
+    int len = buf_len+show_pos;
+    if (sign < 0) len++;
+    len += show_base_len;
+    int padding = len > w ? 0 : w - len;
+
+    // Do actual output.
+    register streambuf* sbuf = stream.rdbuf();
+    ios::fmtflags pad_kind =
+	stream.flags() & (ios::left|ios::right|ios::internal);
+    char fill_char = stream.fill();
+    if (padding > 0
+	&& pad_kind != (ios::fmtflags)ios::left
+	&& pad_kind != (ios::fmtflags)ios::internal) // Default (right) adjust.
+	if (_IO_padn(sbuf, fill_char, padding) < padding)
+	  goto failed;
+    if (sign < 0 || show_pos)
+      {
+	char ch = sign < 0 ? '-' : '+';
+	if (sbuf->sputc(ch) < 0)
+	  goto failed;
+      }
+    if (show_base_len)
+	if (_IO_sputn(sbuf, show_base, show_base_len) <= 0)
+	  goto failed;
+    if (pad_kind == (ios::fmtflags)ios::internal && padding > 0)
+      if (_IO_padn(sbuf, fill_char, padding) < padding)
+	goto failed;
+    if (_IO_sputn (sbuf, buf_ptr, buf_len) != buf_len)
+      goto failed;
+    if (pad_kind == (ios::fmtflags)ios::left && padding > 0) // Left adjustment
+      if (_IO_padn(sbuf, fill_char, padding) < padding)
+	goto failed;
+    stream.osfx();
+    return;
+  failed:
+    stream.set(ios::badbit);
+    stream.osfx();
+}
+
+ostream& ostream::operator<<(int n)
+{
+    if (opfx()) {
+	_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
+				  _strbuf);
+	int sign = 1;
+	unsigned int abs_n = (unsigned)n;
+	if (n < 0 && (flags() & (ios::oct|ios::hex)) == 0)
+	    abs_n = -((unsigned)n), sign = -1;
+	write_int(*this, abs_n, sign);
+	_IO_cleanup_region_end (0);
+    }
+    return *this;
+}
+
+ostream& ostream::operator<<(unsigned int n)
+{
+    if (opfx()) {
+	_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
+				  _strbuf);
+	write_int(*this, n, 0);
+	_IO_cleanup_region_end (0);
+    }
+    return *this;
+}
+
+
+ostream& ostream::operator<<(long n)
+{
+    if (opfx()) {
+	_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
+				  _strbuf);
+	int sign = 1;
+	unsigned long abs_n = (unsigned long)n;
+	if (n < 0 && (flags() & (ios::oct|ios::hex)) == 0)
+	    abs_n = -((unsigned long)n), sign = -1;
+	write_int(*this, abs_n, sign);
+	_IO_cleanup_region_end (0);
+    }
+    return *this;
+}
+
+ostream& ostream::operator<<(unsigned long n)
+{
+    if (opfx()) {
+	_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
+				  _strbuf);
+	write_int(*this, n, 0);
+	_IO_cleanup_region_end (0);
+    }
+    return *this;
+}
+
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+ostream& ostream::operator<<(long long n)
+{
+    if (opfx()) {
+	_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
+				  _strbuf);
+	int sign = 1;
+	unsigned long long abs_n = (unsigned long long)n;
+	if (n < 0 && (flags() & (ios::oct|ios::hex)) == 0)
+	    abs_n = -((unsigned long long)n), sign = -1;
+	write_int(*this, abs_n, sign);
+	_IO_cleanup_region_end (0);
+    }
+    return *this;
+}
+
+
+ostream& ostream::operator<<(unsigned long long n)
+{
+    if (opfx()) {
+	_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
+				  _strbuf);
+	write_int(*this, n, 0);
+	_IO_cleanup_region_end (0);
+    }
+    return *this;
+}
+#endif /*__GNUC__*/
+
+ostream& ostream::operator<<(double n)
+{
+    if (opfx()) {
+	_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
+				  _strbuf);
+	// Uses __cvt_double (renamed from static cvt), in Chris Torek's
+	// stdio implementation.  The setup code uses the same logic
+	// as in __vsbprintf.C (also based on Torek's code).
+	int format_char;
+	if ((flags() & ios::floatfield) == ios::fixed)
+	    format_char = 'f';
+	else if ((flags() & ios::floatfield) == ios::scientific)
+	    format_char = flags() & ios::uppercase ? 'E' : 'e';
+	else
+	    format_char = flags() & ios::uppercase ? 'G' : 'g';
+
+	int prec = precision();
+	if (prec <= 0 && !(flags() & ios::fixed))
+	  prec = 6; /* default */
+
+	// Do actual conversion.
+#if _G_HAVE_PRINTF_FP
+	{
+	  struct printf_info info = { /* prec: */ prec,
+				      /* width: */ width(0),
+				      /* spec: */ format_char,
+				      /* is_long_double: */ 0,
+				      /* is_short: */ 0,
+				      /* is_long: */ 0,
+				      /* alt: */ (flags() & ios::showpoint) != 0,
+				      /* space: */ 0,
+				      /* left: */ (flags() & ios::left) != 0,
+				      /* showsign: */ (flags() & ios::showpos) != 0,
+				      /* group: */ 0,
+#if defined __GLIBC__ && __GLIBC__ >= 2
+				      /* extra: */ 0,
+#if __GLIBC_MINOR__ >= 1
+				      /* is_char: */ 0,
+#if __GLIBC_MINOR__ >= 2
+				      /* wide: */ 0,
+				      /* i18n: */ 0,
+#endif
+#endif
+#endif
+				      /* pad: */ fill()
+	  };
+	  const void *ptr = (const void *) &n;
+	  if (__printf_fp (rdbuf(), &info, &ptr) < 0)
+	    set(ios::badbit|ios::failbit);
+	}
+#elif defined  _IO_USE_DTOA
+	if (_IO_outfloat(n, rdbuf(), format_char, width(0),
+			 prec, flags(),
+			 flags() & ios::showpos ? '+' : 0,
+			 fill()) < 0)
+	    set(ios::badbit|ios::failbit); // ??
+#else
+	int fpprec = 0; // 'Extra' (suppressed) floating precision.
+	if (prec > MAXFRACT) {
+	    if (flags() & (ios::fixed|ios::scientific) & ios::showpos)
+		fpprec = prec - MAXFRACT;
+	    prec = MAXFRACT;
+	}
+	int negative;
+	char buf[BUF];
+	int sign = '\0';
+	char *cp = buf;
+	*cp = 0;
+	int size = __cvt_double(n, prec,
+				flags() & ios::showpoint ? 0x80 : 0,
+				&negative,
+				format_char, cp, buf + sizeof(buf));
+	if (negative) sign = '-';
+	else if (flags() & ios::showpos) sign = '+';
+	if (*cp == 0)
+	    cp++;
+
+	// Calculate padding.
+	int fieldsize = size + fpprec;
+	if (sign) fieldsize++;
+	int padding = 0;
+	int w = width(0);
+	if (fieldsize < w)
+	    padding = w - fieldsize;
+
+	// Do actual output.
+	register streambuf* sbuf = rdbuf();
+	register i;
+	char fill_char = fill();
+	ios::fmtflags pad_kind =
+	    flags() & (ios::left|ios::right|ios::internal);
+	if (pad_kind != (ios::fmtflags)ios::left // Default (right) adjust.
+	    && pad_kind != (ios::fmtflags)ios::internal)
+	    for (i = padding; --i >= 0; ) sbuf->sputc(fill_char);
+	if (sign)
+	    sbuf->sputc(sign);
+	if (pad_kind == (ios::fmtflags)ios::internal)
+	    for (i = padding; --i >= 0; ) sbuf->sputc(fill_char);
+
+	// Emit the actual concented field, followed by extra zeros.
+	_IO_sputn (sbuf, cp, size);
+	for (i = fpprec; --i >= 0; ) sbuf->sputc('0');
+
+	if (pad_kind == (ios::fmtflags)ios::left) // Left adjustment
+	    for (i = padding; --i >= 0; ) sbuf->sputc(fill_char);
+#endif
+	osfx();
+	_IO_cleanup_region_end (0);
+    }
+    return *this;
+}
+
+#if _G_HAVE_LONG_DOUBLE_IO
+ostream& ostream::operator<<(long double n)
+{
+  if (opfx())
+    {
+      _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
+				_strbuf);
+      int format_char;
+      if ((flags() & ios::floatfield) == ios::fixed)
+	format_char = 'f';
+      else if ((flags() & ios::floatfield) == ios::scientific)
+	format_char = flags() & ios::uppercase ? 'E' : 'e';
+      else
+	format_char = flags() & ios::uppercase ? 'G' : 'g';
+
+      int prec = precision();
+      if (prec <= 0 && !(flags() & ios::fixed))
+	prec = 6; /* default */
+
+#if _G_HAVE_PRINTF_FP
+      // Do actual conversion.
+      struct printf_info info = { /* prec: */ prec,
+				  /* width: */ width(0),
+				  /* spec: */ format_char,
+			          /* is_long_double: */ 1,
+				  /* is_short: */ 0,
+				  /* is_long: */ 0,
+				  /* alt: */ (flags() & ios::showpoint) != 0,
+				  /* space: */ 0,
+				  /* left: */ (flags() & ios::left) != 0,
+				  /* showsign: */ (flags() & ios::showpos) != 0,
+				  /* group: */ 0,
+#if defined __GLIBC__ && __GLIBC__ >= 2
+				  /* extra: */ 0,
+#if __GLIBC_MINOR__ >= 1
+				  /* is_char: */ 0,
+#if __GLIBC_MINOR__ >= 2
+				  /* wide: */ 0,
+				  /* i18n: */ 0,
+#endif
+#endif
+#endif
+				  /* pad: */ fill()
+      };
+
+      const void *ptr = (const void *) &n;
+
+      if (__printf_fp (rdbuf(), &info, &ptr) < 0)
+	set (ios::badbit|ios::failbit);
+#else
+# error "long double I/O using dtoa or cvt_double is not implemented"
+#endif
+      osfx();
+      _IO_cleanup_region_end (0);
+    }
+  return *this;
+}
+#endif
+
+ostream& ostream::operator<<(const char *s)
+{
+  if (opfx())
+    {
+      _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
+				_strbuf);
+      if (s == NULL)
+	s = "(null)";
+      int len = strlen(s);
+      int w = width(0);
+// FIXME: Should we: if (w && len>w) len = w;
+      char fill_char = fill();
+      register streambuf *sbuf = rdbuf();
+      register int padding = w > len ? w - len : 0;
+      if (!(flags() & ios::left) && padding > 0) // Default adjustment.
+	if (_IO_padn(sbuf, fill_char, padding) != padding)
+	  {
+	    set(ios::badbit);
+	    goto failed;
+	  }
+      if (_IO_sputn (sbuf, s, len) != len)
+	{
+	  set(ios::badbit);
+	  goto failed;
+	}
+      if (flags() & ios::left && padding > 0) // Left adjustment.
+	if (_IO_padn(sbuf, fill_char, padding) != padding)
+	  set(ios::badbit);
+     failed:
+      osfx();
+      _IO_cleanup_region_end (0);
+    }
+  return *this;
+}
+
+#if 0
+ostream& ostream::operator<<(const void *p)
+{ Is in osform.cc, to avoid pulling in all of _IO_vfprintf by this file. */ }
+#endif
+
+ostream& ostream::operator<<(register streambuf* sbuf)
+{
+  if (opfx())
+    {
+      _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
+				_strbuf);
+      char buffer[_IO_BUFSIZ];
+      register streambuf* outbuf = _strbuf;
+      for (;;)
+	{
+	  _IO_size_t count = _IO_sgetn(sbuf, buffer, _IO_BUFSIZ);
+	  if (count <= 0)
+	    break;
+	  if (_IO_sputn(outbuf, buffer, count) != count)
+	    {
+	      set(ios::badbit);
+	      break;
+	    }
+	}
+      osfx();
+      _IO_cleanup_region_end (0);
+    }
+  return *this;
+}
+
+ostream::ostream(streambuf* sb, ostream* tied)
+{
+  init (sb, tied);
+}
+
+ostream& ostream::seekp(streampos pos)
+{
+    pos = _strbuf->pubseekpos(pos, ios::out);
+    if (pos == streampos(EOF))
+	set(ios::badbit);
+    return *this;
+}
+
+ostream& ostream::seekp(streamoff off, _seek_dir dir)
+{
+  streampos pos = _IO_seekoff (_strbuf, off, (int) dir, _IOS_OUTPUT);
+  if (pos == streampos(EOF))
+    set(ios::badbit);
+  return *this;
+}
+
+streampos ostream::tellp()
+{
+#if 1
+    streampos pos = _IO_seekoff (_strbuf, 0, _IO_seek_cur, _IOS_OUTPUT);
+#else
+    streampos pos = _strbuf->pubseekoff(0, ios::cur, ios::out);
+#endif
+    if (pos == streampos(EOF))
+	set(ios::badbit);
+    return pos;
+}
+
+ostream& ostream::flush()
+{
+    if (_strbuf->sync())
+	set(ios::badbit);
+    return *this;
+}
+
+ostream& flush(ostream& outs)
+{
+  return outs.flush();
+}
+
+istream& ws(istream& ins)
+{
+    if (ins.ipfx1()) {
+	_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
+				  ins._strbuf);
+	int ch = skip_ws(ins._strbuf);
+	if (ch == EOF)
+	    ins.set(ios::eofbit);
+	else
+	    ins._strbuf->sputbackc(ch);
+	ins.isfx();
+	_IO_cleanup_region_end (0);
+    }
+    return ins;
+}
+
+// Skip white-space.  Return 0 on failure (EOF), or 1 on success.
+// Differs from ws() manipulator in that failbit is set on EOF.
+// Called by ipfx() and ipfx0() if needed.
+
+int istream::_skip_ws()
+{
+    int ch = skip_ws(_strbuf);
+    if (ch == EOF) {
+	set(ios::eofbit|ios::failbit);
+	return 0;
+    }
+    else {
+	_strbuf->sputbackc(ch);
+	return 1;
+    }
+}
+
+ostream& ends(ostream& outs)
+{
+    outs.put('\0');
+    return outs;
+}
+
+ostream& endl(ostream& outs)
+{
+    return flush(outs.put('\n'));
+}
+
+istream& lock(istream& ins)
+{
+  _IO_flockfile (ins._strbuf);
+  return ins;
+}
+istream& unlock(istream& ins)
+{
+  _IO_funlockfile (ins._strbuf);
+  return ins;
+}
+ostream& lock(ostream& outs)
+{
+  _IO_flockfile (outs._strbuf);
+  return outs;
+}
+ostream& unlock(ostream& outs)
+{
+  _IO_funlockfile (outs._strbuf);
+  return outs;
+}
+
+
+ostream& ostream::write(const char *s, streamsize n)
+{
+    if (opfx()) {
+	_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
+				  _strbuf);
+	if (_IO_sputn(_strbuf, s, n) != n)
+	    set(ios::failbit);
+	osfx();
+	_IO_cleanup_region_end (0);
+    }
+    return *this;
+}
+
+void ostream::do_osfx()
+{
+    if (flags() & ios::unitbuf)
+	flush();
+    if (flags() & ios::stdio) {
+	fflush(stdout);
+	fflush(stderr);
+    }
+}
+
+iostream::iostream(streambuf* sb, ostream* tied)
+{
+  init (sb, tied);
+}
+
+// NOTE: extension for compatibility with old libg++.
+// Not really compatible with fistream::close().
+#ifdef _STREAM_COMPAT
+void ios::close()
+{
+  if (_strbuf->_flags & _IO_IS_FILEBUF)
+    ((struct filebuf*)rdbuf())->close();
+  else if (_strbuf != NULL)
+    rdbuf()->sync();
+  _strbuf = NULL;
+  _state = badbit;
+}
+
+int istream::skip(int i)
+{
+    int old = (_flags & ios::skipws) != 0;
+    if (i)
+	_flags |= ios::skipws;
+    else
+	_flags &= ~ios::skipws;
+    return old;
+}
+#endif
diff -urNEBb gcc-2.95.3-orig/libio/fileops.c gcc-2.95.3/libio/fileops.c
--- gcc-2.95.3-orig/libio/fileops.c	1999-04-12 20:27:49.000000000 +0200
+++ gcc-2.95.3/libio/fileops.c	2003-12-02 17:50:55.000000000 +0100
@@ -419,7 +419,7 @@
   return retval;
 }
 
-_IO_pos_t
+_IO_off_t
 _IO_file_seekoff (fp, offset, dir, mode)
      _IO_FILE *fp;
      _IO_off_t offset;
@@ -587,7 +587,7 @@
   return read (fp->_fileno, buf, size);
 }
 
-_IO_pos_t
+_IO_off_t
 _IO_file_seek (fp, offset, dir)
      _IO_FILE *fp;
      _IO_off_t offset;
diff -urNEBb gcc-2.95.3-orig/libio/gen-params gcc-2.95.3/libio/gen-params
--- gcc-2.95.3-orig/libio/gen-params	1999-03-24 00:58:21.000000000 +0100
+++ gcc-2.95.3/libio/gen-params	2003-12-02 17:50:55.000000000 +0100
@@ -709,20 +709,20 @@
 fi
 
 # A little test program to check if __printf_fp is available.
-cat >dummy.c <<EOF
-int main()
-{
-    return __printf_fp ();
-}
-EOF
-
-if ${CC} dummy.c >/dev/null 2>&1 ; then
-  echo "#define ${macro_prefix}HAVE_PRINTF_FP 1"
-  echo "#define ${macro_prefix}HAVE_LONG_DOUBLE_IO 1"
-else
+# cat >dummy.c <<EOF
+# int main()
+# {
+#     return __printf_fp ();
+# }
+# EOF
+
+#if ${CC} dummy.c >/dev/null 2>&1 ; then
+#  echo "#define ${macro_prefix}HAVE_PRINTF_FP 1"
+#  echo "#define ${macro_prefix}HAVE_LONG_DOUBLE_IO 1"
+#else
   echo "#define ${macro_prefix}HAVE_PRINTF_FP 0"
   echo "#define ${macro_prefix}HAVE_LONG_DOUBLE_IO 0"
-fi
+#fi
 
 # Uncomment the following line if you don't have working templates.
 # echo "#define ${macro_prefix}NO_TEMPLATES"
diff -urNEBb gcc-2.95.3-orig/libio/genops.c gcc-2.95.3/libio/genops.c
--- gcc-2.95.3-orig/libio/genops.c	1999-03-05 01:19:08.000000000 +0100
+++ gcc-2.95.3/libio/genops.c	2003-12-02 17:50:55.000000000 +0100
@@ -467,10 +467,10 @@
     return fp;
 }
 
-_IO_pos_t
+_IO_off_t
 _IO_default_seekpos (fp, pos, mode)
      _IO_FILE *fp;
-     _IO_pos_t pos;
+     _IO_off_t pos;
      int mode;
 {
   return _IO_SEEKOFF (fp, _IO_pos_as_off (pos), 0, mode);
@@ -551,7 +551,7 @@
   _IO_un_link (fp);
 }
 
-_IO_pos_t
+_IO_off_t
 _IO_default_seekoff (fp, offset, dir, mode)
      _IO_FILE *fp;
      _IO_off_t offset;
@@ -882,7 +882,7 @@
   return (unsigned char) *fp->_IO_read_ptr;
 }
 
-_IO_pos_t
+_IO_off_t
 _IO_default_seek (fp, offset, dir)
      _IO_FILE *fp;
      _IO_off_t offset;
diff -urNEBb gcc-2.95.3-orig/libio/ioseekoff.c gcc-2.95.3/libio/ioseekoff.c
--- gcc-2.95.3-orig/libio/ioseekoff.c	1997-09-16 18:00:21.000000000 +0200
+++ gcc-2.95.3/libio/ioseekoff.c	2003-12-02 17:50:55.000000000 +0100
@@ -25,7 +25,7 @@
 
 #include <libioP.h>
 
-_IO_pos_t
+_IO_off_t
 _IO_seekoff (fp, offset, dir, mode)
      _IO_FILE *fp;
      _IO_off_t offset;
diff -urNEBb gcc-2.95.3-orig/libio/ioseekpos.c gcc-2.95.3/libio/ioseekpos.c
--- gcc-2.95.3-orig/libio/ioseekpos.c	1997-09-16 18:00:23.000000000 +0200
+++ gcc-2.95.3/libio/ioseekpos.c	2003-12-02 17:50:55.000000000 +0100
@@ -25,10 +25,10 @@
 
 #include <libioP.h>
 
-_IO_pos_t
+_IO_off_t
 _IO_seekpos (fp, pos, mode)
      _IO_FILE *fp;
-     _IO_pos_t pos;
+     _IO_off_t pos;
      int mode;
 {
   _IO_pos_t retval;
diff -urNEBb gcc-2.95.3-orig/libio/strops.c gcc-2.95.3/libio/strops.c
--- gcc-2.95.3-orig/libio/strops.c	1998-05-22 22:40:02.000000000 +0200
+++ gcc-2.95.3/libio/strops.c	2003-12-02 17:50:55.000000000 +0100
@@ -205,7 +205,7 @@
 	  - fp->_IO_read_base);
 }
 
-_IO_pos_t
+_IO_off_t
 _IO_str_seekoff (fp, offset, dir, mode)
      _IO_FILE *fp;
      _IO_off_t offset;
diff -urNEBb gcc-2.95.3-orig/texinfo/intl/dcgettext.c gcc-2.95.3/texinfo/intl/dcgettext.c
--- gcc-2.95.3-orig/texinfo/intl/dcgettext.c	1998-03-24 20:41:04.000000000 +0100
+++ gcc-2.95.3/texinfo/intl/dcgettext.c	2003-12-02 17:50:55.000000000 +0100
@@ -86,6 +86,8 @@
 
 /* @@ end of prolog @@ */
 
+#undef getcwd
+
 #ifdef _LIBC
 /* Rename the non ANSI C functions.  This is required by the standard
    because some ANSI C functions will require linking with this object
diff -urNEBb gcc-2.95.3-orig/texinfo/makeinfo/makeinfo.c gcc-2.95.3/texinfo/makeinfo/makeinfo.c
--- gcc-2.95.3-orig/texinfo/makeinfo/makeinfo.c	1999-05-28 04:10:10.000000000 +0200
+++ gcc-2.95.3/texinfo/makeinfo/makeinfo.c	2003-12-02 17:50:56.000000000 +0100
@@ -1598,7 +1598,7 @@
           if (c)
             username[i - 1] = 0;
 
-          user_entry = getpwnam (username);
+          user_entry = 0; //getpwnam (username);
 
           if (!user_entry)
             return (xstrdup (filename));
